cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Using Reference outside of Loops when using SmartAssembly - Rookie question

szundel
1-Newbie

Using Reference outside of Loops when using SmartAssembly - Rookie question

I can't find anything in the help about how to use a reference outside of a For or While loop in SmartAssembly.


I am copying an assembly with the drawing and I am trying to set the reference name for the drawing using Copy_REF - which works in the loop but the last line "SWITCH_TO_MDL TOP_LEVEL_DRW" fails.


Any help would be greatly appreciated!


-Scot



USE_LIBRARY_MDL lib:templates\TROUGH_GUARD_TL asm_copy TOP_LEVEL_ASSY


GET_SESSION_MDLS MDL_TYPES DRAWING MDLS_IN_SESSION_ARRAY
FOR mdl REF ARRAY MDLS_IN_SESSION_ARRAY
GET_MDL_TYPE mdl MDL_TYPE
IF MDL_TYPE == "DRAWING"
COPY_REF mdl TOP_LEVEL_DRW
SWITCH_TO_MDL TOP_LEVEL_DRW
INSERT_DRW_SHEET TOP_LEVEL_DRW 2
WAIT
END_IF
END_FOR


SWITCH_TO_MDL TOP_LEVEL_DRW


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

You need to declare any variables or references outside (before entry
to) the FOR or WHILE loop if you want to access them outside of the loop
once it has been completed.

Charlie Fuller
SIGMAXIM, Inc. Norwood Corporate Center
1502 Providence Highway, Unit 2, Norwood, MA 02062
(Tel) 617-981-6500 x327 (Fax) 617-830-0768
(Toll free) 877-SIGMAXIM www.sigmaxim.com



Excellent.Thanks Charlie!

Top Tags