Inventor Vb.Net "AddIn" - Get iProperties "Sub-Type" & Description Properties

Inventor Vb.Net "AddIn" - Get iProperties "Sub-Type" & Description Properties

isocam
Collaborator Collaborator
581 Views
3 Replies
Message 1 of 4

Inventor Vb.Net "AddIn" - Get iProperties "Sub-Type" & Description Properties

isocam
Collaborator
Collaborator

Can anybody help?

 

Please see the attached file.

 

Does anybody know how I can get the iProperties using a Vb.Net "AddIn" application?

 

I have the following Vb.Net code....

 

Private Sub m_applicationEvents_OnSaveDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_applicationEvents.OnSaveDocument
If BeforeOrAfter = EventTimingEnum.kBefore Then
????????????
End If
End Sub

 

I need, for testing purposes, to show the Sub-Type & Description and show the results in a message box.

 

Also,

 

Show custom properties.

 

Many thanks in advance!

 

Darren

0 Likes
582 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor

Dim d as inventor.document = DocumentObject

Dim p as inventor.property = d.propertysets.item(3).item("description")

Msgbox(p.value)

Msgbox(d.subtype)

 

I am using my Phone, but something like this

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 4

nedeljko.sovljanski
Advocate
Advocate

hi @isocam 

you can use Item(numericalValue).Item(numericalValue) to access right value here is list of properties

Item(1).Item(3) is Author

Property Sets

  1. Name : "Inventor Summary Information"
    1. Name : "Title"
    2. Name : "Subject"
    3. Name : "Author"
    4. Name : "Keywords"
    5. Name : "Comments"
    6. Name : "Last Saved By"
    7. Name : "Revision Number"
    8. Name : "Thumbnail"
  2. Name : "Inventor Document Summary Information"
    1. Name : "Category"
    2. Name : "Manager"
    3. Name : "Company"
  3. Name : "Design Tracking Properties"
    1. Name : "Creation Time"
    2. Name : "Part Number"
    3. Name : "Project"
    4. Name : "Cost Center"
    5. Name : "Checked By"
    6. Name : "Date Checked"
    7. Name : "Engr Approved By"
    8. Name : "Engr Date Approved"
    9. Name : "User Status"
    10. Name : "Material"
    11. Name : "Part Property Revision Id"
    12. Name : "Catalog Web Link"
    13. Name : "Part Icon"
    14. Name : "Description"
    15. Name : "Vendor"
    16. Name : "Document SubType"
    17. Name : "Document SubType Name"
    18. Name : "Proxy Refresh Date"
    19. Name : "Mfg Approved By"
    20. Name : "Mfg Date Approved"
    21. Name : "Cost"
    22. Name : "Standard"
    23. Name : "Design Status"
    24. Name : "Designer"
    25. Name : "Engineer"
    26. Name : "Authority"
    27. Name : "Parameterized Template"
    28. Name : "Template Row"
    29. Name : "External Property Revision Id"
    30. Name : "Standard Revision"
    31. Name : "Manufacturer"
    32. Name : "Standards Organization"
    33. Name : "Language"
    34. Name : "Defer Updates"
    35. Name : "Size Designation"
    36. Name : "Categories"
    37. Name : "Stock Number"
    38. Name : "Weld Material"
    39. Name : "Mass"
    40. Name : "SurfaceArea"
    41. Name : "Volume"
    42. Name : "Density"
    43. Name : "Valid MassProps"
    44. Name : "Flat Pattern Width"
    45. Name : "Flat Pattern Length"
    46. Name : "Flat Pattern Area"
    47. Name : "Sheet Metal Rule"
    48. Name : "Last Updated With"
    49. Name : "Sheet Metal Width"
    50. Name : "Sheet Metal Length"
    51. Name : "Sheet Metal Area"
    52. Name : "Material Identifier"
    53. Name : "Appearance"
    54. Name : "Flat Pattern Defer Update"
0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

Hi @isocam.  Here is an example code, starting with your original code, that you may be able to use.  I was not sure which version of SubType you really needed (the GUID type String, or the 'readable' String), so I included them both.  The regular one returns essentially the same as Document.SubType property, but the other one returns the readable value, like you see in the iProperties dialog, where you are pointing to in the image.

Private Sub m_applicationEvents_OnSaveDocument(ByVal DocumentObject As Inventor._Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_applicationEvents.OnSaveDocument
	If BeforeOrAfter = EventTimingEnum.kBefore Then
		Dim oDoc As Inventor.Document = TryCast(DocumentObject, Inventor.Document)
		If oDoc IsNot Nothing Then
			Dim sDescription As String = oDoc.PropertySets.Item(3).Item(14).Value
			Dim sSubType As String = oDoc.PropertySets.Item(3).Item(16).Value
			Dim sSubTypeName As String = oDoc.PropertySets.Item(3).Item(17).Value
			'do something with these values here
		End If
	End If
End Sub

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes