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: 

Styles Editor , sheet metal rule

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
achmidt
742 Views, 5 Replies

Styles Editor , sheet metal rule

Hello,

I just noticed on one of the parts I created when I change sheet metal tule throug iLogic form , material style don`t change automatically to match. Please take a look at the attached part.  So if I change thickness to 5/16 on the form - Sheet metal rule changes to 5/16 and unfold rule changes but not the Material style.... I checked Styles editor and seems everything is correct there. See image.

Any help is apreciated.

Thanks!

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
5 REPLIES 5
Message 2 of 6
xiaodong_liang
in reply to: achmidt

Hi,

 

I gave a test with the iLogic form, it works well to me. I switched the thickness to different values, the active sheet style will swtich to the corresponding style, and the material is also correct. In addition, the snapshot you shared looks ok to me. The thickness is 5/16", the material is  R1687 - 5/16" HRS. Is it wrong?

Message 3 of 6
achmidt
in reply to: achmidt

Good morning,

If you go to iProperties of the part. Physical. - in the Material field it will be R1361 - 1/4"HRS. Its suppose to change to 5/16" but it doesnt for some unknown reason.

Thank you.

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 4 of 6
xiaodong_liang
in reply to: achmidt

Hi,

 

I saw no code changes the iProperties Material after changing SheetMetal style. You will need to add some codes like below in your iLogic rule "STEP#1":

 

//....other codes.

If
ShThk = 0.313 in Then SheetMetal.SetActiveStyle("5/16"& Chr(34)) Else If ShThk = 0.25 Then SheetMetal.SetActiveStyle("1/4"& Chr(34)) Else If ShThk = 0.1345 Then SheetMetal.SetActiveStyle("10ga") Else If ShThk = 0.105 Then SheetMetal.SetActiveStyle("12ga") Else If ShThk = 0.1793 Then SheetMetal.SetActiveStyle("7ga") End If 'add these code to update iProperty doc = ThisDoc.Document oDef= doc.ComponentDefinition currentStyle = oDef.SheetMetalStyles(SheetMetal.GetActiveStyle()) MsgBox(currentStyle.Material.Name) iProperties.Material = currentStyle.Material.Name

//....other codes
Message 5 of 6
achmidt
in reply to: achmidt

Thank you. After I added this code, Material style changes every time I change thickness!

 

Solved!

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 6 of 6
achmidt
in reply to: xiaodong_liang

One more question.

With this code above everything works except the color style change.

Is there any code that will update color style?

Untitled.png

 

Thank you

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen

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

Post to forums  

Autodesk Design & Make Report