#1
|
|||
|
|||
Entity Overlapped
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? Last edited by brm; 04-21-2004 at 06:43 AM. |
#2
|
||||
|
||||
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?
__________________
John Scheffel |
#3
|
|||
|
|||
This is the file macro (in italian).
|
#4
|
||||
|
||||
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 |
#5
|
||||
|
||||
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:
Code:
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) .....
__________________
John Scheffel |
#6
|
|||
|
|||
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. |
#7
|
|||
|
|||
please stop yelling...
|
#8
|
||||
|
||||
Quote:
Code:
ELSE_IF (nome_parte_toccata<>nome_parte_attiva) DISPLAY 'ATTENZIONE!! Devi toccare una LINEA un CERCHIO o un ARCO nella parte corrente!' END_IF 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.
__________________
John Scheffel |
#9
|
|||
|
|||
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 |
#10
|
||||
|
||||
Quote:
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?
__________________
John Scheffel |
#11
|
|||
|
|||
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. |
#12
|
||||
|
||||
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.
__________________
John Scheffel |
#13
|
|||
|
|||
Now it work correctly.
Thanks for the suggestion. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|