01-03-2019
02:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-03-2019
02:29 PM
Ok then, you need to open both documents and assign each one a variable, or if you are going to do a batch process, open the base document memorize its values, then open all the batch children to copy too.
dim docBase as inventor.document = thisapplication.documents.open(fullfilepathBase)
dim docChild as inventor.document = thisapplication.documents.open(fullfilepathChild)
Once they are open the rest is pretty simple:
properties are organized into property Sets, and to know which ones you wish to change you can run this probing routine I created:
Public Sub ReadOutPropertySets(invDoc As Inventor.Document)
Try
Dim strPropertySets As String = "Inventor Property Sets" & vbCrLf & "{Property Set Name}" & vbCrLf & "{Property.DisplayName, Property.Name, Property.ID, Property.Type, Property.Expression, Property.Value}"
For Each pset As PropertySet In invDoc.PropertySets
strPropertySets += vbCrLf & pset.Name
For Each prop As [Property] In pset
Try
strPropertySets += vbCrLf & " " & prop.DisplayName & ", " & prop.Name & ", " & prop.PropId & ", " & prop.Type & ", " & prop.Expression & ", " & prop.Value
Catch ex As Exception
End Try
Next
Next
MsgBox(strPropertySets)
Catch ex As Exception
End Try
End Sub
once you have identified the exact property set name and property name (or property id), you can access it with the same features in the above code prop.value = xxx, and/or variable = prop.value
jvj