Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Sergio.D.Suárez
in reply to: Cosmin_V

This is an example. (You attach only the assembly file, its components are missing, so I do not know the parameters of each part)
There is an assembly parameter, when "feeder_L =" ON "" will change the parameter "d0" of the "Cub" part to the value 1.2.
when "feeder_L =" OFF "" the parameter "d0" of the "feeder_L" part is changed to the value 5.
Note how the entry of the part name has been modified, so when you change the name of the file you will not have problems.

 

Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition
oDef = oDoc.ComponentDefinition

Dim oCub As ComponentOccurrence = oDef.Occurrences.Item(1)
Dim oFeederL  As ComponentOccurrence = oDef.Occurrences.Item(2)
Dim oFeederR As ComponentOccurrence = oDef.Occurrences.Item(3)

	MessageBox.Show(oCub.Name)
	MessageBox.Show(oFeederL.Name)
	MessageBox.Show(oFeederR.Name)


If feeder_L = "ON" Then
	Parameter(oCub.Name, "d0") = 1.2
End If

If feeder_L = "OFF" Then
	Parameter(oFeederL.Name, "d0") = 5
End If

 


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