#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
#3
|
||||
|
||||
Re: Delete small circles less than 5 mm
Trye to use this:
DELETE POINTER (INQ 2) |
#4
|
|||
|
|||
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 |
#5
|
||||
|
||||
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... |
#6
|
|||
|
|||
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. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|