CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-07-2012, 09:46 AM
Gerard Leclercq Gerard Leclercq is offline
Registered User
 
Join Date: Jan 2007
Location: France
Posts: 17
Delete small circles less than 5 mm

Hello,
Is there a means or a macro to delete in one shot all circles whose size is less than 5 mm, for example ?
I have made a macro, but it takes a lot of time and sometimes, it does not find an existing vertex, then stops.

Gerard

LET Texte ( DGETTEXT 'fdms' 'Deleted small circles ')
LET Cpt 0
LET Cpt1 0
INQ_SELECTED_ELEM SELECT CIRCLES ALL CONFIRM
LET Total (INQ 14)
WHILE ((INQ 14)<>0)
LET Cpt (Cpt+1)
LET Rayon (INQ 3)
IF (2*Rayon<=Net_action_petit_elts_taille)
DELETE SELECT CIRCLES BOX (( INQ 101 )-1.001*( PNT_XY Rayon Rayon)) (( INQ 101 )+1.001*( PNT_XY Rayon Rayon)) AND VERTEX PICK_VP_PNT Cloture (INQ 102) CONFIRM END
LET Cpt1 (Cpt1+1)
DISPLAY_NO_WAIT (Texte + STR Cpt1 + '/' + STR Total)
END_IF
INQ_NEXT_ELEM
END_WHILE
Reply With Quote
  #2  
Old 06-29-2012, 11:42 AM
ldavis@tensorengr.co ldavis@tensorengr.co is offline
Registered User
 
Join Date: Mar 2009
Location: Florida
Posts: 7
Re: Delete small circles less than 5 mm

Gerard,

I do not know what version of ME10 you are using but this will delete circles of a set size (Del_size) adjusted by a tolerance (Tolrance) and display the number of circles deleted (DISPLAY Del_cnt). You can change this macro to delete circles of a given size (Del_size) and below by changing the IF statement as I have indicated. The size can be fine tuned by adjusting the Tolrance value.

DEFINE Del_hole_size
LOCAL Curr_units
LOCAL Del_cnt
LOCAL Tolrance
LOCAL Up_limit
LOCAL Lw_limit
{ inquire environment for current units }
INQ_ENV 19
LET Curr_units (INQ 601)
LET Del_cnt (0)
{ size of hole to delete }
LET Del_size (5)
{ adjust Del_size per current units }
IF (Curr_units=INCHES)
LET Del_size (Del_size/2/25.4)
ELSE_IF (Curr_units=MM)
LET Del_size (Del_size/2)
END_IF

{ tolerance adjustment due to ME10's decimal inaccuracy }
LET Tolrance (0.001)

{ select ALL circles on the sheet }
INQ_SELECTED_ELEM SELECT CIRCLES ALL CONFIRM
LOOP
EXIT_IF (INQ 14=0)
{ define upper and lower tolerance limits of selected circle }
LET Up_limit ((INQ 3)+Tolrance)
LET Lw_limit ((INQ 3) - Tolrance)
{ compare upper and lower limits of current circle }
IF ((Del_size<=Up_limit) AND (Del_size>=Lw_limit))
<--- change to "IF (Del_size <= Up_limit)" to delete ALL circles of Del_size or less { delete circle by it POINTER }
DELETE POINTER (INQ 2)
END
{ add "1" to deleted cicrlce count }
LET Del_cnt (Del_cnt+1)
END_IF
INQ_NEXT_ELEM
END_LOOP

{ display number of circles deleted }
DISPLAY Del_cnt
END_DEFINE


Hope this helps.

Larry
Reply With Quote
  #3  
Old 06-29-2012, 12:25 PM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Delete small circles less than 5 mm

Trye to use this:

DELETE POINTER (INQ 2)
Reply With Quote
  #4  
Old 06-29-2012, 01:20 PM
ldavis@tensorengr.co ldavis@tensorengr.co is offline
Registered User
 
Join Date: Mar 2009
Location: Florida
Posts: 7
Re: Delete small circles less than 5 mm

Shaba,

I am not sure if your response is a question or a statement. The use of "DELETE POINTER (INQ 2)" works in conjunction with the "INQ_SELECTED_ELEM SELECT CIRCLES ALL CONFIRM" and the "INQ_NEXT_ELEM" statements. As you step through your selected elements, the POINTER (INQ 2) gets populated with the next elements unique indentifier.

Larry
Reply With Quote
  #5  
Old 06-29-2012, 01:49 PM
Shaba's Avatar
Shaba Shaba is offline
Registered User
 
Join Date: Nov 2006
Location: Italy
Posts: 215
Re: Delete small circles less than 5 mm

My is a statement

Not use this
DELETE SELECT CIRCLES BOX (( INQ 101 )-1.001*( PNT_XY Rayon Rayon)) (( INQ 101 )+1.001*( PNT_XY Rayon Rayon)) AND VERTEX PICK_VP_PNT Cloture (INQ 102) CONFIRM END

Trye to use ths
DELETE POINTER (INQ 2)

It should works...
Reply With Quote
  #6  
Old 07-02-2012, 03:53 AM
Gerard Leclercq Gerard Leclercq is offline
Registered User
 
Join Date: Jan 2007
Location: France
Posts: 17
Re: Delete small circles less than 5 mm

Thank you all,

The solution was using POINTER qualifier I did not know about (it is not documented). This solves my problem.

Have a good day.
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 11:17 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.
You Rated this Thread: