Sending Assembly Parameters to Unopened Assembly iLogic

Sending Assembly Parameters to Unopened Assembly iLogic

felix.cortes5K3Y2
Advocate Advocate
414 Views
2 Replies
Message 1 of 3

Sending Assembly Parameters to Unopened Assembly iLogic

felix.cortes5K3Y2
Advocate
Advocate

Hi forum,

 

I was wondering if there's a way to send parameters from Assembly 1 to an unopened Assembly 2. The parameters have to be sent through a rule from Assembly 1 to send the parameters to Assembly 2. 

 

Best regards,

Felix

0 Likes
Accepted solutions (1)
415 Views
2 Replies
Replies (2)
Message 2 of 3

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

 

Dim Ass1Doc As Document
Ass1Doc = ThisDoc.Document
Dim Ass1DocCompDef As ComponentDefinition = Ass1Doc.ComponentDefinition
Ass1Path = ThisDoc.PathAndFileName(True)

Dim Ass2Path As String = "D:\Inventor\Planos en Inventor\Trabajos\530 CABALLETES\530.08A_Cab.6Cajas(el par)\530.08A_Cab.6Cajas(el par).iam"

' Open the Ass2Path document invisible.
Dim Ass2Doc As Document
Ass2Doc = ThisApplication.Documents.Open(Ass2Path, False)
Dim Ass2DocCompDef As ComponentDefinition = Ass2Doc.ComponentDefinition

Dim oParamsToLink As ObjectCollection
oParamsToLink = ThisApplication.TransientObjects.CreateObjectCollection

' parameters with these names.
oParamsToLink.Add(Ass1DocCompDef.Parameters.Item("d0"))
oParamsToLink.Add(Ass1DocCompDef.Parameters.Item("d1"))
oParamsToLink.Add(Ass1DocCompDef.Parameters.Item("Test"))

' exported and hence will result in changing the source part.
Dim oDerivedParamTable As DerivedParameterTable
oDerivedParamTable = Ass2Doc.ComponentDefinition.Parameters. _
DerivedParameterTables.Add2(Ass1Path, oParamsToLink)

Ass2Doc.Save
Ass2Doc.Close

Hi, this rule I think it does what you need, you have an Assy1 assembly open and you try to send the parameters "d0", "d1", "Test", to the Assy2 assembly (you must place the complete path of this assembly).
Open Assy2 in hidden mode and make the links, then save the file and close it.
Make sure you place the names of the parameters you want to export correctly to avoid errors.
I hope it helps to solve your problem. regards 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 3

felix.cortes5K3Y2
Advocate
Advocate

Thanks Sergio!

0 Likes