Retreieve iProperty from specified file

Retreieve iProperty from specified file

Anonymous
Not applicable
709 Views
16 Replies
Message 1 of 17

Retreieve iProperty from specified file

Anonymous
Not applicable

From a drawing, I want to retrieve a custom iProperty from a specific file. The code below works, but my file is in a parent folder. How do I specify the path for this file? If I include it directly together with the file name, it only interprets it as part of the file name, not the path.. 

 

iProperties.Value("file.iam", "Custom", "Test")

0 Likes
710 Views
16 Replies
Replies (16)
Message 2 of 17

bradeneuropeArthur
Mentor
Mentor

From where do you want to retrieve the I-properties?
From and ipt iam idw dwg file?

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 17

Anonymous
Not applicable
I want to retrieve from an iam file (file.iam) Can't figure out how to specify the path
0 Likes
Message 4 of 17

bradeneuropeArthur
Mentor
Mentor
Public Sub op()

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.Documents.Open("YOUR DOCUMENT FULL NAME", False)

'FOR EACH PROPERTY SET YOU NEED TO DEFINE Item(?).Item
'FOR EACH PROPERTY YOU NEED TO DEFINE Item(x).Item(?)
MsgBox b.PropertySets.Item(1).Item(1).Name
MsgBox b.PropertySets.Item(1).Item(1).Value
End Sub

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 5 of 17

Anonymous
Not applicable
Perfect! Can I use property name instead of item number using this method?
0 Likes
Message 6 of 17

bradeneuropeArthur
Mentor
Mentor
Yes

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 7 of 17

bradeneuropeArthur
Mentor
Mentor
Change 1 into propertyname

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 8 of 17

bradeneuropeArthur
Mentor
Mentor
If you need help please let me know

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 9 of 17

bradeneuropeArthur
Mentor
Mentor

These are the propetysets:

  1. = Inventor Summary Information
  2. = Inventor Document Summary Information
  3. = Design Tracking Properties
  4. = Inventor User Defined Properties

then your propertyname:

like "Title"

 

msgbox (b.propertysets.item("Inventor Summary Information").item("Title").value)

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 10 of 17

Anonymous
Not applicable

I still cant get this to work. The VBA language is also unknown to me. I've just played around with VB.net. 

 

So, I have the assembly: file.iam

I have the path by: 

SyntaxEditor Code Snippet

Dim oFile As String = "\Model\file.iam"
Dim oPath As String = ThisDoc.Path
Dim oDir As New System.IO.FileInfo(oPath) 
oFull = oPath.DirectoryName + oFile

Which gives me: C:\Vault\Model\file.iam

In file.iam, there is a custom iproperty named "Tag1"

In another folder, I have a drawing. I want to retrieve Tag1 in this drawing. 

 

0 Likes
Message 11 of 17

Anonymous
Not applicable

I can even open the specified file.iam by using 

 

ThisApplication.Documents.Open(oFull, True) 

 

 But I can not use the command SyntaxEditor Code Snippet

iProperties.Value(oFull, "Custom", "Tag1") 

as it interprets oFull as a document name, not a document name + path.  

0 Likes
Message 12 of 17

Anonymous
Not applicable

I use this code"

 

If ThisDrawing.ModelDocument Is Nothing Then Exit Sub
modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
iProperties.Value("Summary", "Title") = iProperties.Value(modelName,"Summary", "Title")
iProperties.Value("Project", "Description") = iProperties.Value(modelName,"Project", "Description")
iProperties.Value("Summary", "Subject") = iProperties.Value(modelName,"Summary", "Subject")
0 Likes
Message 13 of 17

Anonymous
Not applicable

Thanks, but that is still only referring to the model referenced in the drawing. What I can't figure out is how to link to a different file than used in the drawing. I want to retrieve these properties from an assembly in a parent folder..

0 Likes
Message 14 of 17

bradeneuropeArthur
Mentor
Mentor
Set your illogic code to straight vb . coding

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 15 of 17

bradeneuropeArthur
Mentor
Mentor
Don't know what you mean. Do you need to open a different dwg or the dwg from an assembly.

Please explain a little more to clarify the question...

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 16 of 17

bradeneuropeArthur
Mentor
Mentor

Public Sub op() Dim a As Application Set a = ThisApplication Dim b As DrawingDocument Set b = a.Documents.Open("YOUR DOCUMENT FULL NAME", False) 'FOR EACH PROPERTY SET YOU NEED TO DEFINE Item(?).Item 'FOR EACH PROPERTY YOU NEED TO DEFINE Item(x).Item(?) Dim Propset as propertyset set Propset = b.PropertySets.Item("Inventor Summary Information") '= Inventor Summary Information '= Inventor Document Summary Information '= Design Tracking Properties '= Inventor User Defined Properties msgbox (Propset.Name) Dim Prop as property set Prop = Propset.item("Title") msgbox prop.Name MsgBox prop.value End Sub

This For Vb:

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 17 of 17

bradeneuropeArthur
Mentor
Mentor

And this for illogic:

 

Public Sub main()

Dim a As Application
a = ThisApplication

Dim b As DrawingDocument
b = a.Documents.Open("C:\Vault\Projects\Drawing1.dwg", False)

'FOR EACH PROPERTY SET YOU NEED TO DEFINE Item(?).Item
'FOR EACH PROPERTY YOU NEED TO DEFINE Item(x).Item(?)
Dim Propset As PropertySet
 Propset = b.PropertySets.Item("Inventor Summary Information")
'= Inventor Summary Information
'= Inventor Document Summary Information
'= Design Tracking Properties
'= Inventor User Defined Properties
MsgBox (Propset.Name)

Dim Prop As Inventor.Property
 Prop = Propset.Item("Title")
MsgBox (Prop.Name)

MsgBox (Prop.Value)
End Sub

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