Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
When I need to pass the parameter description from Drawing to PTC_COMMON_NAME of Windchill 12.1.2.0 thre are two ways depend if thre is a part or assembly in the model of drawing: PTC_COMMON_NAME:D= PTC_COMMON_NAME:0 for Part and PTC_COMMON_NAME:D= PTC_COMMON_NAME:1 for Assembly.
There are any condition for to know if is a part or assembly in the program after upload to Windchill?
Thanks.
P.D. I work in Creo 9.0.3.
Solved! Go to Solution.
Well, I think you can simply add this line to the drawing program of your template drawing:
PTC_COMMON_NAME:D = PTC_COMMON_NAME:MDL
Then upon adding the 1st model to the drawing, the line will be revised and the "MDL" will be replaced by the session ID of the model.
I don't know if this answers your question, but when you're looking at session IDs, if the number is odd, it's an assembly. If the session ID is an even number, it's a part.
Yes, but I need is for the program to see what the model is and depending on this, set the parameter 0 or 1.
Well, I think you can simply add this line to the drawing program of your template drawing:
PTC_COMMON_NAME:D = PTC_COMMON_NAME:MDL
Then upon adding the 1st model to the drawing, the line will be revised and the "MDL" will be replaced by the session ID of the model.
Yes, working.
Thank you, very much.
I did want to add that changing the PTC_COMMON_NAME from a relation or program only works for *NEW* objects. Once uploaded into Windchill, that parameter becomes locked for the object.
So in this case, another user will likely see an error pop up in their Creo message log when they open such drawing (error which can be ignored, but just FYI)