Hi everybody,
I found this code from the iLogic Drawing Batch Tool 2015:
'check For Parameter And create If Not found Try oTest = Parameter("ActionList") Catch ' Get the active document. Assumes a part document is active. Dim partDoc As PartDocument partDoc = ThisApplication.ActiveDocument ' Get the UserParameters collection Dim userParams As UserParameters userParams = partDoc.ComponentDefinition.Parameters.UserParameters oParam = userParams.AddByValue("ActionList", "", UnitsTypeEnum.kTextUnits) End Try oApp = ThisApplication Auto = iLogicVb.Automation Dim iLogicAuto As Object iLogicAuto = Auto Dim oDoc As Document oDoc = ThisApplication.ActiveDocument Dim oIndexNumber As Integer 'sets index number for the first run If oIndexNumber < 0 Then oIndexNumber = 0 End If 'create list and add default value Dim oRuleList As New ArrayList 'get collection of rules Dim ruleName As String Dim rules As Object rules = iLogicAuto.rules(oDoc) 'make sure there are rules in the file 'and then add them to the list If Not (rules Is Nothing) Then For Each rule In rules ruleName = rule.Name If rule.Name.Contains("***") Then oRuleList.add(ruleName) 'Set List MultiValue.List("ActionList") = oRuleList End If Next Else 'no rules found Return End If
Is it possible to add the names of parts and subassemblies which are located in my main assembly to a list in a similar way?
Solved! Go to Solution.
Solved by Darrell.johnson. Go to Solution.
Hoping that partslist may be helpful to get the names of parts and subassembly. VBA sample code is available at below link.
http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-5B02B07C-FAEA-4107-A3AD-F6FFC317D134
Thanks and regards,
Unfortunately this is not what I was looking for. But I figured it out for myself.
This is the code:
Dim MyArrayList1 As New ArrayList Dim oComp As ComponentOccurrence Dim oComps As ComponentOccurrences oComps = ThisDoc.Document.ComponentDefinition.Occurrences For Each oComp In oComps MyArrayList1.Add(oComp.Name) Next
Can't find what you're looking for? Ask the community or share your knowledge.