PDA

View Full Version : ME-10: Change diameter of a circle


John Bruce
09-14-1998, 10:42 AM
The following was originally posted to the ME-10 group, but since it is a macro question I decided to post it here as well.<p><p>Does anyone currently have a macro that will change the diameter of a circle without having to delete and redraw the geometry.<p>thanks in advance Steve<p> p.s. please include syntax for command in your reply s.<p><p>I have a macro that will change the diameter of a circle that you can have. I wrote it to do one then quit, so if you want to go though several in a row, you will need to modify it to add a loop. And now for a try at manual HTML.<p>with luck this is on a new line<p><pre>DEFINE CCD LOCAL CIR LOCAL R1 LOCAL R2 LOCAL R3 LOCAL Ctr LOCAL D2 read pnt 'Pick the circle to change' CIR inq_elem CIR if (inq 403 <> CIRCLE) display 'The element you picked is NOT A CIRCLE' CCD else let R1 (inq 3) let Ctr (inq 101) read number 'Enter the NEW DIAMETER for this circle' D2 let R2 (D2/2) let R3 (R2/R1) MODIFY Assistance DEL_OLD SCALE CENTER Ctr R3 CIR END END_DEFINE </PRE>

Darren Litherland
09-14-1998, 08:15 PM
Nice macro John. How about improving slightly so it takes ARCS and FILLETS? You should also consider adding GLOBAL to your MODIFY selection. Your macro will rescale a whole part if the circle you identify is not in the active part! Your HTML went very well! Darren

John Bruce
09-15-1998, 03:09 AM
Darren<p> Thanks for the suggestion to add global to the modify command. I slammed this thing together rather quickly, and did not even think of the effects on a non-current part. In light of this, the line that reads:<p>MODIFY Assistance DEL_OLD<p> should read:<p>MODIFY Assistance DEL_OLD GLOBAL Cir<p>The "Assistance" can be removed, as this macro asks for a new size and as such there is no need for the CoPilot functionality.<p>I did not include fillets or arcs in this macro since they are normally specified and understood as being controlled by their radius not a diameter. Also I did not see much sense creating a macro for fillets when you can just us the CHANGE_FILLET command.<p>Here is a "trick" that I came upon by accident that is very handy.<p>If you want to see what command(s) are issued when you pick an item from a screen or tablet menu type:<p>text '<p>then pick the screen or tablet menu slot. Now move the cursor back onto the drawing area. You will see a box representing text, now click to place the text. What you will see is the command that is issued when you pick that menu item. i.e. try the polygon item in the Create 1 menu set. You will see:<p>LINE Assistance POLYGON<p>This has been very handy for info while writing macros, as well as understanding why some menu picks do what they do. John

Darren Litherland
09-15-1998, 07:32 PM
But what about circles that have been split? They consist of multiple ARCS. It would be a shame to have to go back to the MODIFY SCALE command just because the macro doesn't allow arcs. Very nice tip about TEXT " I tried with ENTER " and that gives you the output directly on the command line. This means you can use "Page Up" afterwards. Keep it comin' - Darren