Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
After scouring through the forums I was able to piece together the code below (My coding skills are very weak). It works but needs some modifications I can't quite figure out.
'the document is being opened
Dim openDoc As Document = ThisDoc.Document
Dim ETOproset As PropertySet
Dim ETOProperty As Inventor.Property
Dim ETO As Double
Dim ETOHasDrawing As Boolean = False
'This code opens every document related to this assembly
For Each doc As Document In openDoc.AllReferencedDocuments
'This code allows loops to continue if the wanted parameters dont exist in the part or assembly
On Error Resume Next
ETOproset = doc.PropertySets.Item("Inventor User Defined Properties")
ETOproset.Add(ETOHasDrawing, "TotalETOHasDrawing")
Next
In short, what I'm trying to do is, from a top level assembly, apply this...
iProperties.Value("Custom", "TotalETODrawing") = iProperties.Value("Project", "Part Number") & "-Sht1#J:\" & (Left(ThisDoc.FileName, 6)) & "\MECH\DETAILS\" & iProperties.Value("Project", "Part Number") & "-Sht1.pdf#"
iProperties.Value("Custom", "TotalETOHasDrawing") = True
...to all components that are NOT in a library. This would be applied at the component level so the part# would reflect each components part# and not the assembly part#. Also if those properties already exist on some components, I would like it to overwrite it with these new values.
Any help would be greatly appreciated.
Solved! Go to Solution.