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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Output Column Headings in Family Tables for "named" dimensions with Smart Assembly.

ptc-198847
2-Explorer

Output Column Headings in Family Tables for "named" dimensions with Smart Assembly.

Does anyone know of a way to output the column headings of a family table of "named" dimensions with Smart Assembly?
Example, dimension d0 was renamed to LENGTH, but when I output the column headings, it shows me d0.
Thanks in advance,
Doug


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.
4 REPLIES 4

Doug, This might be a long way around but seems to work to match the d# (variable namedEACH_FAM_ITEM) with the dimension name (variable named EACH_FAM_ITEM_NAME):



BEGIN_ASM_DESCR


DECLARE_ARRAY FAM_TABLE_ITEMS
DECLARE_ARRAY ALL_DIMS


DECLARE_VARIABLE STRING EACH_FAM_ITEM_NMBR
DECLARE_VARIABLE STRING EACH_FAM_ITEM_NAME
DECLARE_VARIABLE INTEGER DIM_COLON_POS


COPY_REF THIS MODEL
GET_FAMITEMS MODEL FAM_TABLE_ITEMS
SEARCH_MDL_REFS MODEL "DIMENSION" "*" ALL_DIMS


FOR EACH_FAM_ITEM REF ARRAY FAM_TABLE_ITEMS
EACH_FAM_ITEM_NMBR = strreplace(EACH_FAM_ITEM, "d", ", TRUE)

FOR EACH_DIM_ITEM REF ARRAY ALL_DIMS
GET_DIM_SYMBOL EACH_DIM_ITEM WITH_SESSION_ID EACH_DIM_ITEM_SYMBOL

GET_REF_ID EACH_DIM_ITEM EACH_DIM_ITEM_ID

DIM_COLON_POS = strfind (EACH_DIM_ITEM_SYMBOL, ":")

IF itos(EACH_DIM_ITEM_ID) == EACH_FAM_ITEM_NMBR
EACH_FAM_ITEM_NAME = strmid(EACH_DIM_ITEM_SYMBOL, 0, DIM_COLON_POS)
BREAK
END_IF
END_FOR

PRINT "% %" EACH_FAM_ITEM EACH_FAM_ITEM_NAME
EACH_FAM_ITEM_NAME = "
END_FOR


END_ASM_DESCR



Note I only tested it on a simple part that had three columns in the fam table with dimensionsd2, d1, d0.


Rick.

Rick,


That's a neat idea. We didn't realize that you could use the GET_REF_ID command to extract the d# value for the dimensions. I did look over your code and would suggest a coupl of very minor changes.


1 - Don't use the variable name "MODEL" as this is a default keyword used by SmartAssembly similar to "LIKE" and "PART". I know it works for this application, but I've seen some commands have a fit with this keyword and try to drive it to a different model than what I'm working with.


2 - You don't need to retrieve the "WITH_SESSION_ID" in the GET_DIM_SYMBOL command. In this case, it's just giving you extra information that serves no purpose, and makes you have to do extra work with the string later.


Joel Beckley


Application Engineer


SIGMAXIM

Joel, Thanks for the input. I originally thought session ID would bethe d# but it was always 0 and then forgot to take the option out. Cleaned up code in attached tab file. What does the session ID refer to?


Rick.

Because of the template functionality in drawing mode, Creo adds the "session id" information to any note or dimension that is manually added to the drawing. That session ID is related to the model number in relation to the drawing. If a drawing only has one model associated with it, that session ID will always be :0, whereas a drawing with multiple models will have :0, :1, :2, etc...


We added this functionality so that users can quickly get the session ID if they need to use it for model relations and drawing notes. 99 times out of 100, those notes on drawings will automatically fill in, but there are times where we need the session ID, so the optional flag was added to some of the commands.


Joel Beckley


Application Engineer


SIGMAXIM

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags