Propertie set names where are they? vb.net

Propertie set names where are they? vb.net

Anonymous
Not applicable
4,806 Views
1 Reply
Message 1 of 2

Propertie set names where are they? vb.net

Anonymous
Not applicable

Hi,

 

I have a bit of a peeve.. I cant ever seem to find the right names for propertiesets or propertieste values other than ussing my own logical thinking to what they may be. In the following code I am trying to access my title found in the "Inventor Document Summary Information", but it dosnt seem to recognise the propertieset cattagory for Title... how can I find all these for once and for all, wild guessing is like cracking a safe???

 

        Dim invApp As Inventor.Application
        invApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
        Dim Doc As Inventor.Document
        Doc = invApp1.ActiveDocument

        ' Get the "Summary Information" property set.  
        Dim summaryPropSet As Inventor.PropertySet
        summaryPropSet = Doc.PropertySets.Item("Inventor Document Summary Information")


        ' Get the "Titel" property.  
        Dim companyProp As Inventor.Property
        companyProp = summaryPropSet.Item("Titel")

        ' Change the value of the iProperty.  
        companyProp.Value = TextBox1.Text

 

Accepted solutions (1)
4,807 Views
1 Reply
Reply (1)
Message 2 of 2

MegaJerk
Collaborator
Collaborator
Accepted solution

You can find the names of the Property Sets & Properties in by using a debugger. The bundled VBA tool works very well for accomplishing this. Near the bottom of this post, I will list all of the actual PropertySet names along with the Names of the Properties belonging to them. 

As for you code there are a few minor mistakes that are probably causing you a bit of a headache. 

Assuming that you're using iLogic and you're not writing a plugin, there are some simplifications I have made to your code. See the following. 

Dim Doc As Document
Doc = ThisApplication.ActiveDocument

' Get the "Summary Information" property set.  
Dim summaryPropSet As PropertySet
summaryPropSet = Doc.PropertySets.Item("Summary Information")


' Get the "Title" property.  
Dim companyProp As Inventor.Property
companyProp = summaryPropSet.Item("Title")


' Change the value of the iProperty.  
companyProp.Value = TextBox1.Text


First and foremost, instead of that long drawn-out call to the Application. I've simplified it using the iLogic built in 'ThisApplication' object. This allowed me to remove the Marshal Get Object stuff that was happening. In addition to correcting the PropertySet name to "Summary Information", I have also corrected a spelling error for Title (you had originally written it as 'Titel'). 

If you are indeed writing a plugin or WinForm program, feel free to reinsert the Marshal GetObject calls. The important part is the PropertySet stuffs. 

Because I do not see TextBox1.Text ever declared anywhere, be aware that this may throw an error no matter. 

----- 

As for the Property Sets. Here is a list of them. 

----

PropertySets:

DispalyName = “Summary Information”
InternalName = “{F29F85E0-4FF9-1068-AB91-08002B27B3D9}”
Properties = “Title”, “Subject”, “Author”, “Keywords”, “Comments”, “Last Saved By”, “Revision Number”, “Thumbnail”


DisplayName = “Document Summary Information”
InternalName = “{D5CDD502-2E9C-101B-9397-08002B2CF9AE}”
Properties = “Category”, “Manager”, “Company”


DisplayName = “Design Tracking Properties”
InternalName = “{32853F0F-3444-11D1-9E93-0060B03C1CA6}”
Properties = “Creation Time”, “Part Number”, “Project”, “Cost Center”, “Checked By”, “Date Checked”, “Engr Approved By”, “Engr Date Approved”, “User Status”, “Material”, “Part Property Revision Id”, “Catalog Web Link”, “Part Icon”, “Description”, “Vendor”, “Document SubType”, “Document SubType Name”, “Proxy Refresh Date”, “Mfg Approved By”, “Mfg Date Approved”, “Cost”, “Standard”, “Design Status”, “Designer”, “Engineer”, “Authority”, “Parameterized Template”, “Template Row”, “External Property Revision Id”, “Standard Revision”, “Manufacturer”, “Standards Organization”, “Language”, “Defer Updates”, “Size Designation”, “Categories”, “Stock Number”, “Weld Material”, “Mass”, “SurfaceArea”, “Volume”, “Density”, “Valid MassProps”, “Flat Pattern Width”, “Flat Pattern Length”, “Flat Pattern Area”, “Sheet Metal Rule”, “Last Updated With”, “Sheet Metal Width”, “Sheet Metal Length”, “Sheet Metal Area”, “Material Identifier”, “Appearance”

 

DisplayName = “User Defined Properties”
InternalName = “{D5CDD505-2E9C-101B-9397-08002B2CF9AE}”
-----------------------------------

 

I hope that this helps you on your journey. To learn a bit more about the VBA debugger (and program prototyping), see this : http://modthemachine.typepad.com/my_weblog/2008/10/program-prototyping.html

 

 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub