VBA code to get and set the category design tracking iProperty metadata.

VBA code to get and set the category design tracking iProperty metadata.

tom.prichard
Contributor Contributor
922 Views
3 Replies
Message 1 of 4

VBA code to get and set the category design tracking iProperty metadata.

tom.prichard
Contributor
Contributor

My code in an abbreviated form looks like this,,,

 

Set oDoc = ThisApplication.ActiveDocument
Set oPropertySets = oDoc.PropertySets
Set oDesignProperty = oPropertySets.Item("Design Tracking Properties")
'Set oProp = oDesignProperty.Item("Category") 'No-such iProperty
Set oProp = oDesignProperty.Item("Categories") '(Saves but does not display in iProps dialogue)

 

Will someone please let me know why the 'category' and/or 'categories' prop. does not populate the iProperties when set by VBA? Thank you for any assistance you can provide.

0 Likes
Accepted solutions (1)
923 Views
3 Replies
Replies (3)
Message 2 of 4

sundars
Autodesk
Autodesk
Accepted solution

Hi @tom.prichard 

 

The  "Document Summary" property has a category item in it. Is that what you want?

 

Set oDoc = ThisApplication.ActiveDocument
Set oPropertySets = oDoc.PropertySets
Set oDesignProperty = oPropertySets.Item("Document Summary Information")
Set oProp = oDesignProperty.Item("Category") 

 

Thanks

-shiva

 

Shiva Sundaram
Inventor Development
0 Likes
Message 3 of 4

tom.prichard
Contributor
Contributor

I was using this,,,

'Set oDocumentProperty = oPropertySets.Item("Inventor Document Summary Information")

,,,not,,,
Set oDocumentProperty = oPropertySets.Item("Document Summary Information")

 

,,,because of test output from this,,,,

For Each oUserProperty oPropertySets
   'MsgBox (oDocumentProperty.Name)
   Debug.Print (oUserProperty.Name)
Next oUserProperty

 

 

YOU ARE RIGHT,,,, solved,

Message 4 of 4

johnsonshiue
Community Manager
Community Manager

Hi Tom,

 

"Categories" seems to be a hidden property. Here is what I got from Inventor API help.

 

kCategoriesDesignTrackingProperties 56 Categories: String (VT_BSTR), Read Only, No UI, XML string providing the complete categorization of this model, along with the mappings of the Category Parameters to parameters within this Document.

 

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes