PDA

View Full Version : Selecting elements using a "LAST" command


boomy44
05-23-2003, 07:45 AM
I am trying to write a macro that will insert a bolt hole, and then create a pattern from the one bolt hole. Is there a way of selecting the last element or part using the MODIFY commands rather than physical selecting the element or part on screen?

I have tried using parametrics but parameters only work on the top part. I am trying to limit user interaction other than providing the spacing. Any ideas would be greatly appreciated.

Thom Ivancso
05-23-2003, 08:53 AM
One way you can do this is to use something as follows

ADD_CURRENT_INFO 'Temporial info for selecting'
CIRCLE P1 R1
COLOR YELLOW LINETYPE DASH_CENTER
LINE (P1+PNT_RA (R1*1.5) A) (P1 - PNT_RA (R1*1.5) A)
IF (N>1)
MODIFY COPY ROTATE (N -1) P (360/N) SELECT INFOS
'Temporial info for selecting' CONFIRM
END_IF
CHANGE_CURRENT_INFO 'Temporial info for selecting' ''
CHANGE_ELEM_INFO 'Temporial info for selecting' '' ALL

What is happening here is we are adding infos to the items being created under the ADD_CURRENT_INFO command and then passing that information to use in the MODIFY COPY ROTATE command as it selection set.

I have attached the entire macro so you can see the whole thing work. It just creats a simple circular array of through holes.

:)

boomy44
05-26-2003, 07:53 AM
Thom...thanks for the file. I has given me some ideas for solving my problem.:)