Message 1 of 3

Not applicable
09-17-2020
09:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been trying to collect Model/User/Reference parameters of Frame Generated Components in an assembly.
But somehow I can not get "Parameters" to work with Component Occurrences.
Can anyone please suggest how can I access these parameters (or Parameter Values to be more specific) of each frame generated parts in an assembly?
I am new to the API programming.
Here's the code:
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then MsgBox("This rule '" & iLogicVb.RuleName & "' only works for Drawing Documents.",vbOK, "WRONG DOCUMENT TYPE") Return End If ' Get the active assembly. Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument ' Get the assembly component definition. Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = oAsmDoc.ComponentDefinition ' Create the Enumerator to catch all the leaf occurrences of the assembly. Dim oLeafOccs As ComponentOccurrencesEnumerator oLeafOccs = oAsmCompDef.Occurrences.AllLeafOccurrences ' Iterate through the occurrences and print the name. Dim oOcc As ComponentOccurrence 'Dim oparams As Parameters params = oLeafOccs.Parameters Dim userparams As ModelParameters = params.ModelParameters For Each oOcc In oLeafOccs 'MsgBox("This Line") Dim u As String u = iProperties.Material(oOcc.Name) MessageBox.Show(u, "Parameters") Next
Solved! Go to Solution.