Design - Shaft and using "fx" string

Design - Shaft and using "fx" string

Anonymous
Not applicable
411 Views
2 Replies
Message 1 of 3

Design - Shaft and using "fx" string

Anonymous
Not applicable

I need to pull dimensions from my shafts created with "Shaft Generator", (i.e. Main Dia, overall length) so I can auto populate the materials filed in my drawings.  Everything I have tried so far has failed.  I am not sure what the parameter names are or where to find them for the dimensions I need.

0 Likes
Accepted solutions (1)
412 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Hey There 

 

First figure out which parameter(i.e user or model or renamed etc ) you want to pull in to the drawing 

 

 

Please provide me little more details like image or something 

0 Likes
Message 3 of 3

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

Design Accelerator creates quite simple assembly structure – one assembly with parts only.

DA assembly and parts always have the property set "FDesign",
its internal name is “{6CD3181A-0C7D-41aa-BDB3-969A9B72E1BB}”.

Shaft sub-assembly component should have the attribute “Data“ from the attribute set "FDesign".  It contains all important information about shaft component in XML format.  You should be able to find all information you need in this xml string.

The following vba sample prints this attribute value to the immediate window.

Sub Explore_DA_Shaft_Assy()
 
    Dim oAsmDoc As AssemblyDocument
    Set oAsmDoc = ThisApplication.ActiveDocument
    Dim oAsmDef As AssemblyComponentDefinition
    Set oAsmDef = oAsmDoc.ComponentDefinition
   
    Dim oOcc As ComponentOccurrence
    Set oOcc = oAsmDef.Occurrences.Item(1) 'shaft subassembly
 
    Dim oAttr As Inventor.Attribute
    Set oAttr = oOcc.AttributeSets.Item("FDesign").Item("Data")
   
    Debug.Print oAttr.value    'print XML data
   
End Sub

 

If you are not familiar with Inventor attributes, the following overview could be useful:

Introduction to Attributes

http://modthemachine.typepad.com/my_weblog/2009/07/introduction-to-attributes.html


Best regards, 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes