Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
trevorauman
in reply to: Anonymous

I was looking for a variety of solutions to this same thing and many resulted in faults and other problems. Then I recalled one of my co-workers doing something similar and he had a very simple bit of code.

 

'Define the open document
Dim openDoc As Document
openDoc = ThisDoc.Document

'Look at all of the files referenced in the open document
Dim docFile As Document
For Each docFile In openDoc.AllReferencedDocuments                
'format  file name                   
Dim FNamePos As Long
FNamePos = InStrRev(docFile.FullFileName, "\", -1)                        
Dim docFName As String 
docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) 
Parameter.Quiet = True
Parameter(docFName, "Parameter1") = Parameter1
Parameter(docFName, "Parameter2") = Parameter2
Parameter(docFName, "Parameter3") = Parameter3
Next

iLogicVb.UpdateWhenDone=True
InventorVb.DocumentUpdate()
ThisApplication.ActiveView.Fit

 This will run just the listed parameters and it will go into each part. There were problems 10 years ago that didn't always push the parameters into some of the subpart and assemblies, but I have not run into that recently. If that is an issue we simply put the code in some of the subassemblies.