VBA code to unflag "USE THICKNESS FROM RULE"

VBA code to unflag "USE THICKNESS FROM RULE"

nicolamora
Contributor Contributor
534 Views
2 Replies
Message 1 of 3

VBA code to unflag "USE THICKNESS FROM RULE"

nicolamora
Contributor
Contributor

I need a VBA code to unflag the "Use Thickness from Rule" in the sheet metal style property.

I tried the "ThisDoc.Document.ComponentDefinition.UseSheetMetalStyleThickness = False" but give me a debug error.

 

Also the following code:

Sub ChangeUseThicknessFromRule()
  Dim doc As PartDocument
  Set doc = ThisApplication.ActiveDocument
  
  Dim cd As SheetMetalComponentDefinition
  Set cd = doc.ComponentDefinition
  
  cd.UseSheetMetalStyleThickness = False
End Sub

 Not sure where is the error.

Thanks,

Nicola

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

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, I have created a metal sheet file and the code that you have created works, it does not show any error. Could you attach your example here to investigate?

 

Sub ChangeUseThicknessFromRule()
  Dim doc As PartDocument
  Set doc = ThisApplication.ActiveDocument
  
  Dim cd As SheetMetalComponentDefinition
  Set cd = doc.ComponentDefinition
  
  cd.UseSheetMetalStyleThickness = False
End Sub

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 3

nicolamora
Contributor
Contributor

I was trying to use the code on an old derived sheet metal part, and it didn't work.

But it works perfectly on new parts. 

I'm guessing the problem was just that.

 

Thanks anyway for your fast reply,

Nicola

  

0 Likes