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: 

How do I set the Sheet Metal Rules Thickness to a UserParameter Variable.

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
1515 Views, 3 Replies

How do I set the Sheet Metal Rules Thickness to a UserParameter Variable.

We are using 2011.

 

I created a VBA tool that populates the FX Userparameters with a Thickness Variable

 

How do I set the Sheet Metal Rules Thickness to the new new FX UserParameter Thickness Variable?

 

for example:

The Userparamter variable name is "cab_thk"

 

Under Sheet Metal Defaults | Sheet Metal Rules | Sheet (Tab)

The Thickness entry should read "cab_thk"

 

Thanks,

3 REPLIES 3
Message 2 of 4
skyngu
in reply to: Anonymous

not sure if this is what you want

 

sName = oDoc.ComponentDefinition.ActiveSheetMetalStyle.name

Autodesk Inventor Professional 2019
Message 3 of 4
xiaoyan.qi
in reply to: skyngu

i recommend you use iLogic, create a new rule and add the code as below

=============================

   Dim oPartDoc As PartDocument

   ' you need add Set before the next line in VBA
    oPartDoc = ThisApplication.ActiveDocument

   ' you need add Set before the next line in VBA

    Dim oSheetMetalCompDef As SheetMetalComponentDefinition
    oSheetMetalCompDef = oPartDoc.ComponentDefinition
   

' "oThick" is the user parameter name in user parameters 
    oSheetMetalCompDef.SheetMetalStyles.Item("Default").Thickness = oThick

=============================

iLogic can be change the value automatically when you parameter change,  and VBA need to run after you change value.

 

of course, you can convert the code above to VBA code easily, just change the oThick to the user parameter statement and make some adjustment.

 

Let me know if it works

 

Thanks

Mick

Message 4 of 4
Anonymous
in reply to: xiaoyan.qi

Well it worked.

 

The API documentation was a little unclear on this topic.  There are too many objects with a Thickness property.

Some I guess are read only.  In my mind those should have been named GetThickness.

 

Thank you for the support.

 

 

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

Post to forums  

Autodesk Design & Make Report