Message 1 of 5

Not applicable
04-14-2021
02:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the assembly, I would like to push the parameter value of the "MainPart" if the parameter exists in the other parts.
"MainPart" parameter conditions: If it contains "x".
Other parts DisplayName conditions: If it contains "Include".
I hope my explaination is understandable.
In pure ilogic, it would be like this:
Parameter("Include_01:1", "x_Width") = Parameter("MainPart:1", "x_Width") Parameter("Include_02:1", "x_Height")=Parameter("MainPart:1", "x_Height")
Here is the unfinished code that my brain can only do.
Dim oDoc As AssemblyDocument = ThisAssembly.Document Dim asmDef = oDoc.ComponentDefinition Dim oMainParam As New ArrayList Dim i As Integer = 0 For Each occ As ComponentOccurrence In asmDef.Occurrences Dim occDoc As Document = occ.Definition.Document If occ.Name.Contains("Main") Then Dim oMain As PartDocument = occDoc MsgBox(oMain.DisplayName) For Each oParam In oMain.ComponentDefinition.Parameters If oParam.Name.Contains("x") Then oMainParam.Add(oParam.Name) 'MsgBox(oMain.DisplayName & vblf & vblf & oParam.Name) End If Next For x As Integer = 0 To oMainParam.Count - 1 xList = xList & vbLf & oMainParam(x) & vbLf Next MessageBox.Show(xList) End If If occDoc.DisplayName.Contains("Include") Then i += 1 MsgBox(i) End If Next
Thank you so much.
Solved! Go to Solution.