Showing results for 
Search instead for 
Did you mean: 

can PMI PartIdentification Class display format be changed?


I'm working on an NXOpen Python-based dialog-box "dashboard" for managing "Specialized PMI" and "Security Marking" from a unified interface.  I've started with the PartIdentification Class objects, and I'm experimenting using the NIST PMI models as subjects.  It seems like when the annotation to represent the PartIdentification PMI object is displayed in the model, it has a set format, and I'd like to know if that can be altered.  By format, I mean which information is displayed, in what order, with what characters around it.


Example: the NIST model file named "827-9999-903 rev c.prt" comes with a PMI object with a displayed PMI attribute object of a type of class 'NXOpen.Annotations.PartIdentification'.  The below code is a snippet of code I used to extract the embedded information:

theSession  = NXOpen.Session.GetSession()
theUI = NXOpen.UI.GetUI()
theParts = theSession.Parts
theWorkPart = theParts.Work
allPMIAttributeObjects = theWorkPart.PmiManager.PmiAttributes
logInfoList = []

for onePMIAttributeObject in allPMIAttributeObjects:
    whatThisIs = str(type(onePMIAttributeObject))
    if whatThisIs == r"<class 'NXOpen.Annotations.PartIdentification'>":
        partIdentificationBuilder1 = theWorkPart.PmiManager.PmiAttributes.\
        logInfoList.append('PartIdentifier: %s\nRevision: %s\n' %
        logInfoList.append('Attribute.Name: %s\nTag: %s\nTitle: %s\n' %
        logInfoList.append('ItemName: %s\nItemNameModifier: %s\n DescriptiveModifier: %s\n BusinessModifier: %s\n' %
        logInfoList.append('Origin.OriginPoint.X: %s\n Origin.OriginPoint.Y: %s\n Origin.OriginPoint.Z: %s\n' %

theUI.NXMessageBox.Show("Survey Embedded Annotations", \
                         NXOpen.NXMessageBox.DialogType.Information, \ 

Apologies for the width of some lines, and I'm not going to promise this snippet will run by itself!



Anyway, the result from the NIST standard model is this information:

PartIdentifier: 827-9999-903.prt
Revision: -
Attribute.Name: Part Identification
Tag: 45834
Title: Part Identification
ItemName: SPACER
ItemNameModifier: SHOULDERED
BusinessModifier: None
Origin.OriginPoint.X: 0.0
Origin.OriginPoint.Y: 2.0309225465744554
Origin.OriginPoint.Z: -0.5603513249290999


(I do believe there are errors in the NIST models just to trip us up.  The Revision in the filename was "c", the revision shown in the drawing sheet in Drafting application is "B", the Revision embedded into the PartIdentification class above is "-", and NONE of those reflect the Revision I gave it in our Teamcenter database.  But that isn't too important, just wanted to point out the discrepancy before someone else does.)


Okay, setting up for my question:

When this annotation is displayed on the PMI_ANNOTATION view, it shows up as:

827-9999-903.prt (-) SPACER, SHOULDERED

which is:

PartIdentifier (Revision) ItemName, ItemNameModifier


But if I don't WANT to show the Revision in parentheses, because () around something means it is for reference only, or I want to put the ItemName on a separate line, I can't figure out how to alter that. 

Question: where or how can I specify a different format for the display of Specialized PMI, such as the PartIdentifier information?


Re: can PMI PartIdentification Class display format be changed?


Since I haven't heard an answer to this,  I'm going to take the information in .PartIdentification and duplicate it into an annotation object that is formatted the way that I want.  I think I'll be able to make sure through my tool that the information doesn't go out of sync, but if people edit it without my tool there could be conflicts.  So having an alternate way to display the .PartInformation note would still be preferred.