Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get the Project Part Number Property from Occurrence within Assembly.

1 REPLY 1
Reply
Message 1 of 2
Anonymous
220 Views, 1 Reply

Get the Project Part Number Property from Occurrence within Assembly.

I had this, which obtained the part document filename.
' PartNo = Left((oPCompRef.ReferencedFileDescriptor.DisplayName),
Len(oPCompRef.ReferencedFileDescriptor.DisplayName) - 4)

Now I want this, to obtain the part number from within the part document.
PartNo =
oPCompRef.ImmediateOccurrences.Item(1).Definition.Document.PropertySets.Item
("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kDescriptionDesignTr
ackingProperties).Value
MsgBox PartNo

Msgbox PartNo produces a value of nothing. Any help is greatly appreciated!
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

I used something like this to change the partnumer of an assemblyoccurence some time ago, maybe it could be to some help....

Set oDoc = oCompOccurrence.Definition.Document
oDoc.PropertySets.Item(3).Item(2).Value = "NewPartNumber"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report