Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Check part parameter within assembly

1 REPLY 1
Reply
Message 1 of 2
phillip.shields
381 Views, 1 Reply

Check part parameter within assembly

Hello, 

 

I'm trying to run a for loop to check a part's thickness parameter within an assembly but I do not know how to access that parameter from the assembly. Once I check that the thickness does not equal 1/4" I want to assign the sheet metal rule to be user defined. Here is what I got so far:

 

Dim SheetMetalRule As String = BODY_GAUGE & " " & SHEET_METAL_RULE

Dim assyDoc As AssemblyDocument
assyDoc = ThisApplication.ActiveDocument

Dim partDoc As Document

For Each partDoc In assyDoc.AllReferencedDocuments
If partDoc.ComponentDefinition.Parameters.UserParameters("THICK").Value = .25 Then
Else If partDoc.ComponentDefinition.Parameters.UserParams.Value <> .25 Then
ThisApplication.Documents.Open(partDoc.FullFileName, False)
SheetMetal.SetActiveStyle(SheetMetalRule)
partDoc.Save
partDoc.Close
End If
Next

 

 

1 REPLY 1
Message 2 of 2
adam.nagy
in reply to: phillip.shields

Hi,

 

The sheet metal thickness parameter seems to be called "Thickness", so this should work.

Also keep in mind that internally length values are in cm. So you would need to convert it - you could also use UnitsOfMeasure class for that.

doc = ThisDoc.Document
MsgBox(doc.ComponentDefinition.Parameters("Thickness").Value)

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report