PDA

View Full Version : Entity Overlapped


brm
04-21-2004, 01:53 AM
IF I HAVE TWO LINES OVERLAPPED IN TWO DIFFERENT PARTS,
WHEN ACTIVE A PART AND SELECT A LINE WITH MY MACRO
I'M NOT SURE IF THE ENTITY SELECTED IS IN THE ACTIVED PART.
THERE IS A COMMAND OR A SINTAX TO SELECT AN ENTITY IN THE CURRENT PART?

John Scheffel
04-21-2004, 01:56 PM
You might want to post in lower case. All caps is interpretted as shouting.

The answer to your question will depend on how your macro is selecting the line. Can you post or attach the macro code?

brm
04-21-2004, 10:12 PM
This is the file macro (in italian).

Thom Ivancso
04-22-2004, 05:30 AM
Looking at your code one of the things I found is that you use the INQ_ELEM function. This is great when you want to select a certain type of element and filter out the ones you do not want to select, the problem is that unlike the normal SELECT function INQ_ELEM will select an element wheter it is contained within an active part or contained within an inactive part. You might want to use just the SELECT function instead.

Also if you are not sure about your active part is the where the items are being selected from you could always write into your macro to view the active part only and remove the rest of the parts from view using the VIEW function as shown below.

-->(VIEW)----------
+->|part name|-----+-->

|--->|point|-------->|

|--->(PARENT)----->|

'------>(TOP)---------'

VIEW causes the selected part to be viewed in the current viewport. You can select the part in several ways -- by entering its name, by identifying its box if it is boxed, by identifying any element in it (except a part) if it is visible, or by entering PARENT or TOP.

The name of the viewed part is shown in the upper-left corner of each viewport.


Hope this helps

Cheers
Thom

John Scheffel
04-22-2004, 02:04 PM
You might try this. After you pick the element with INQ_ELEM, then (INQ 309) should return the unique part number of the part to which the selected element belongs. This was not documented in Help until version 11, but seems to work in version 10.50 as well. Then you can compare the unique part number of the selected element to the unique part number of the current part. The beginning of your macro could be similar to:

LOOP
INQ_PART '.'
LET nome_parte_attiva (INQ 302)

LOOP
READ "Tocca la LINEA, il CERCHIO o l'ARCO nella zona
da rendere in linea tratteggiata" P1
INQ_ELEM P1
LET tipo_elemento (INQ 403)
LET nome_parte_toccata (INQ 309)
EXIT_IF (tipo_elemento<>END)
END_LOOP
IF (nome_parte_toccata=nome_parte_attiva)
.....

brm
04-23-2004, 05:53 AM
I TRIED THIS BUT IS THE SAME RESULT.

I TRIED WITH INQ_SELECTED_ELEM SELECT P1 CONFIRM
AND IT'S OK BUT IN NOT ACTIVE PARTS IS NOT VERY OK.

Harry
04-23-2004, 06:16 AM
please stop yelling... :(

John Scheffel
04-23-2004, 08:54 AM
Originally posted by brm
I tried this but is the same result.

I tried with INQ_SELECTED_ELEM SELECT P1 CONFIRM
and it's OK but in not active parts is not very OK.
I don't understand this comment. From looking at your code, if the selected element is not in the active part, it bypasses most of the code and executes these lines.

ELSE_IF (nome_parte_toccata<>nome_parte_attiva)
DISPLAY 'ATTENZIONE!! Devi toccare una LINEA un CERCHIO
o un ARCO nella parte corrente!'
END_IF

So what is not OK if the selected element is not in the active part?

Also, INQ_SELECTED_ELEM may return the information for multiple elements, so you might have to use INQ_NEXT_ELEM to check each of them in a loop.

It might help if you could provide some description of what this macro is supposed to do and how it is supposed to work.

brm
04-26-2004, 01:36 AM
This macro is very useful in drawings with more parts and it's useful for outlining
a piece of line or of arc that crosses a different part.
With this macro one selection the line or the arc in the zone to modify
therefore touch the points of intersection with other parts or other entity.
This macro cuts the line in the points of intersection and applies the linetype dashed
and it change the color also, red, in this case.

Thanks for help

John Scheffel
04-26-2004, 01:24 PM
Originally posted by brm
This macro is very useful in drawings with more parts and it's useful for outlining a piece of line or of arc that crosses a different part.
With this macro one selection the line or the arc in the zone to modify therefore touch the points of intersection with other parts or other entity.
This macro cuts the line in the points of intersection and applies the linetype dashed and it change the color also, red, in this case.
I tried your macro and works as you described. I tried it with overlapping lines in different parts, and it always seems to pick the line in the current part, or post a message if I try to pick a line not in the current part. So I guess I don't understand what the problem is. How does the macro fail to work as you desire? Can you provide an example MI file and description of how to duplicate the failure?

I did find one issue. When I tried it on overlapping lines, it worked, but then when I used Redraw the red dashed line it created was no longer visible even though it was still there. See the attached GIF, which shows the view with both parts visible, and with only the modified part visible. Could this be why you think it does not work with overlapping lines?

brm
04-26-2004, 11:53 PM
Try the macro in this drawing if active the P2 part in not possible modify the line overlapped with part P1.
If active the P1 part the macro works correctly. Why?

Thanks for help.

John Scheffel
04-27-2004, 09:01 AM
OK, now I see the problem. I think I fixed it by changing a few instances of INQ_ELEM to INQ_SELECTED_ELEM. It seems that INQ_SELECTED_ELEM restricts selection to the active part provided you don't include the GLOBAL option. Try the attached file and see if that works for you.

brm
04-28-2004, 11:45 PM
Now it work correctly.
Thanks for the suggestion.