CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > CoCreate Drafting

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-21-2004, 01:53 AM
brm brm is offline
Registered User
 
Join Date: Dec 2002
Posts: 66
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.
Reply With Quote
  #2  
Old 04-21-2004, 01:56 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
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
Reply With Quote
  #3  
Old 04-21-2004, 10:12 PM
brm brm is offline
Registered User
 
Join Date: Dec 2002
Posts: 66
This is the file macro (in italian).
Attached Files
File Type: txt cut_mod_line.txt (3.1 KB, 493 views)
Reply With Quote
  #4  
Old 04-22-2004, 05:30 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
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
Reply With Quote
  #5  
Old 04-22-2004, 02:04 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
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
Reply With Quote
  #6  
Old 04-23-2004, 05:53 AM
brm brm is offline
Registered User
 
Join Date: Dec 2002
Posts: 66
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.
Reply With Quote
  #7  
Old 04-23-2004, 06:16 AM
Harry Harry is offline
Registered User
 
Join Date: Jan 2004
Posts: 85
Angry

please stop yelling...
Reply With Quote
  #8  
Old 04-23-2004, 08:54 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Quote:
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.
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
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.
__________________
John Scheffel
Reply With Quote
  #9  
Old 04-26-2004, 01:36 AM
brm brm is offline
Registered User
 
Join Date: Dec 2002
Posts: 66
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
Reply With Quote
  #10  
Old 04-26-2004, 01:24 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Quote:
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?
Attached Thumbnails
Click image for larger version

Name:	red_line_visibility.gif
Views:	469
Size:	32.2 KB
ID:	280  
__________________
John Scheffel
Reply With Quote
  #11  
Old 04-26-2004, 11:53 PM
brm brm is offline
Registered User
 
Join Date: Dec 2002
Posts: 66
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.
Attached Files
File Type: zip line1.zip (2.2 KB, 464 views)
Reply With Quote
  #12  
Old 04-27-2004, 09:01 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
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.
Attached Files
File Type: txt cut_mod_line_fix.txt (3.0 KB, 467 views)
__________________
John Scheffel
Reply With Quote
  #13  
Old 04-28-2004, 11:45 PM
brm brm is offline
Registered User
 
Join Date: Dec 2002
Posts: 66
Now it work correctly.
Thanks for the suggestion.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:37 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.