Showing results for 
Search instead for 
Did you mean: 

Get name of the template used to create a drawing sheet


Do drawing sheets, or the views representing those drawing sheets, "remember" what template file was used to create them?  We have various templates for each size of drawing sheet, and I'm putting together a format-filling tool that needs to know which template it is acting on.  I had been using a database attribute like this:

tempAtt = theWorkPart.GetUserAttribute('DB_SEED_PART_USED',
                                        -1) #read in template used

But the value of that attribute, DB_SEED_PART_USED, doesn't get updated if the original sheets are deleted and new sheets are added from a different template.



I searched the NXOpen Python API documentation pages for "template" and found a function related to templates used for family parts (NXOpen.UF.Part.AskTemplateFilename), but nothing like that for drawing sheets.  I don't see a location in the regular NX10 interface where the drawing sheet is aware of its base template, so I can't reverse-engineer a recorded journal.


I know the tags of both the Drawing Object for the sheet and the View Object representing the sheet.  So if there is an attribute I can pull out of either of those objects to get the original template, that would be great.


An alternate method will be to have the user select an alternate template from a list if the DB_SEED_PART_USED attribute isn't correct.  But it would be preferred for the tool to do this seamlessly.