Community
Hi, I'm new to inventor customization , Help in finding the solution for this!!
I have an assembly, i need to get the details(Name, value, type) of user parameters from the individual parts in assembly and export it to csv file.
which all functions do i need to use and how get the parts from assembly?
Hello @Anonymous
You could start with a VBA macro like this:
Public Sub GetUserParameters() If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then Exit Sub Dim myAssy As Inventor.AssemblyDocument Set myAssy = ThisApplication.ActiveDocument Dim myDoc As Inventor.Document For Each myDoc In myAssy.AllReferencedDocuments If myDoc.DocumentType = kPartDocumentObject Then Dim myPart As Inventor.PartDocument Set myPart = myDoc Dim myUP As Inventor.UserParameter For Each myUP In myPart.ComponentDefinition.Parameters.UserParameters Debug.Print "User Parameter " & myUP.Name & " is type " & TypeName(myUP.Value) & " with value " & CStr(myUP.Value) Next myUP End If Next myDoc End Sub
It just dumps to the VBA immediate view all userparameters in all parts in the active assembly.
Regards,
Jens Bejer Pedersen
Developer, Symetri A/S
Can't find what you're looking for? Ask the community or share your knowledge.