I don't have time to write one and I am not at the client that has that rule if no one helps I will get it and post the part. But most of my clients do this.
I have some code that does that. You might need to tweak it for the thicknesses and stuff but here it is. It's part of a smart sheet metal template I've been working on but we still haven't bothered switching to it for multiple reasons.
'Sets sheet thickness parameter for normal sheet and plate Select Case Parameter("Thickness") Case 0.1875 ShtThk = "7GA" Case 0.1640 ShtThk = "8GA" Case 0.1345 ShtThk = "10GA" Case 0.125 ShtThk = "11GA" Case 0.1046 ShtThk = "12GA" Case 0.0747 ShtThk = "14GA" Case 0.0625 ShtThk = "16GA" Case 0.0478 ShtThk = "18GA" Case 0.0359 ShtThk = "20GA" Case 0.0299 ShtThk = "22GA" Case 0.25 ShtThk = "00.25" Case 0.3125 ShtThk = "00.31" Case 0.375 ShtThk = "00.38" Case 0.50 ShtThk = "00.50" Case 0.625 ShtThk = "00.63" Case 0.75 ShtThk = "00.75" Case 0.875 ShtThk = "00.88" Case 1.00 ShtThk = "01.00" Case Else ShtThk = "??" End Select 'Creates the custom iproperty ShetThk and sets it iProperties.Value("Custom", "ShtThk") = ShtThk If (Not ThisDoc.Document.ComponentDefinition.FlatPattern Is Nothing) Then 'These lines set the length and width of the flat pattern to custom iproperties and rounds them to 2 decimal places iProperties.Value("Custom", "Length") = FormatNumber(Iif(SheetMetal.FlatExtentsLength > SheetMetal.FlatExtentsWidth, SheetMetal.FlatExtentsLength , SheetMetal.FlatExtentsWidth ),2) iProperties.Value("Custom", "Width") = FormatNumber(Iif(SheetMetal.FlatExtentsLength > SheetMetal.FlatExtentsWidth, SheetMetal.FlatExtentsWidth , SheetMetal.FlatExtentsLength ),2) End If
I even included a bonus that gets the flat patter size and rounds them to 2 decimal places. Just put something like this in the description or whatever iproperty field you use.
=<ShtThk> X <Width> X <Length>
I would agree with the above. Use the Sheet Metal Style to define the "style" and just enter the appropriate parameters in each style.
iLogic warning: iLogic is a very addictive subject - be prepared to give up your evenings and weekends!
If you really wanted some iLogic to do this, it would probably look like this (untested!!):
(Create a text user parameter called say "Gauge")
Select Case Thickness 'This gets the Sheet metal parameter called "Thickness"ready for some testing...
Case = 0.12 'This is saying "if thickness = 0.12 then do whatever comes next until you hit the next "Case" statement.
Gauge = "11GA" 'Sets Gauge = the right text for your parts list.
Case = 0.105 'And repeat for the next gauge.
Gauge = "12GA"
'I'm sure you can spot the pattern for any more 🙂
End Select 'Finishes the Select Case statement, and since there is nothing after this line, the code ends.