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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Using Reference outside of Loops when using SmartAssembly - Rookie question

szundel
1-Visitor

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
cfuller-2
2-Explorer
(To:szundel)

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



szundel
1-Visitor
(To:szundel)

Excellent.Thanks Charlie!

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags