Flat Extents Precision Format

Flat Extents Precision Format

DewayneH
Advocate Advocate
743 Views
5 Replies
Message 1 of 6

Flat Extents Precision Format

DewayneH
Advocate
Advocate

 

I have been working on a sheet metal rule to get the flat extents. I found some code that does exactly what I need except it is formatted as a fraction.

I figured with a little research I could figure out how to change the formatting to what I need. I failed miserably.

The best I can do is remove the rounding function shown. Once removed, I get a value to six decimal places and leading zeros (0.980178).

 

Is there a way to format the "SheetMetal.FlatExtentsLength" and "SheetMetal.FlatExtentsWidth" as a formatted decimal or text, instead of a fraction?

I just need three decimal places and suppress the leading zeros.

 

 

 

LengthFrac = RoundToFraction(SheetMetal.FlatExtentsLength, 1/16, RoundingMethod.Round)
WidthFrac = RoundToFraction(SheetMetal.FlatExtentsWidth, 1/16, RoundingMethod.Round)

 

Dewayne
Inventor Pro 2023
Vault Pro 2023
0 Likes
Accepted solutions (1)
744 Views
5 Replies
Replies (5)
Message 2 of 6

Jesper_S
Collaborator
Collaborator

Hi.

 

How about 

LengthFrac = Round(SheetMetal.FlatExtentsLength, 3)
WidthFrac = Round(SheetMetal.FlatExtentsWidth, 3)

 //Jesper


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
0 Likes
Message 3 of 6

DewayneH
Advocate
Advocate

 

That does work for rounding, but unfortunately I didn't want to round.

I would like to just show the precision at three decimals, and suppress leading zeros.

 

Is there maybe a reference that shows the proper way and options for formatting the parameter, like this?

Dewayne
Inventor Pro 2023
Vault Pro 2023
0 Likes
Message 4 of 6

bradeneuropeArthur
Mentor
Mentor
Accepted solution
Export it to a parameter.
Then you can customise the parameter value with the format you need.

If further explanation is required please let me know.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 6

bradeneuropeArthur
Mentor
Mentor

This is how:

 

and dot that also for the other parameter.

 

Parameter.Param("LengthFrac").Value = SheetMetal.FlatExtentsLength
Parameter.Param("LengthFrac").Precision = 3
Parameter.Param("LengthFrac").ExposedAsProperty = True
Parameter.Param("LengthFrac").CustomPropertyFormat.ShowLeadingZeros = False
Parameter.Param("LengthFrac").CustomPropertyFormat.ShowTrailingZeros = False

 

Format.PNG

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 6

DewayneH
Advocate
Advocate

I was trying to get around adding more users parameters, but it is simpler this way.

 

Thanks.

Dewayne
Inventor Pro 2023
Vault Pro 2023
0 Likes