Anonymous
374 Views, 1 Reply
07-21-2015
10:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-21-2015
10:41 AM
Custom Property Format - Fractional format with trailing zeros
I have a part template set up for creating flat bar. The template has 3 parameters that I am trying to format as feet and inches with trailing zeros using the "Custom Property Format". I am unable to figure out a way to do this.
When I set the Property Type to "Number" I can check off "Trailing Zeros" but I don't have the option for a "Fractional" format.
When I set the Property Type to "Text" I can set the format to "Fractional" but then I can't check off "Trailing Zeros"
How do I get this formated so a parameter with a value of 12" is shown as 1'-0"?
08-03-2015
08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-03-2015
08:12 AM
I wrote this bit of code to do just that in a string
it rounds up to the nearest 16th
Sub Main() 'CALCULATE RUNG TOTAL LENGTH RUNGTOTLG = "" FEET = Floor(RUNGLG/12) INCH = Floor(RUNGLG - (FEET * 12)) FRAC = Ceil((RUNGLG - (FEET * 12) - INCH) * 16) RUNGTOTLG = FEET & "'- " & INCH & TOFRACTION(FRAC) & Chr(34) End Sub Function TOFRACTION(NEUMERATOR As Integer ) As String Select Case NEUMERATOR Case 0 Return "" Case 1 Return " 1/16" Case 2 Return " 1/8" Case 3 Return " 3/16" Case 4 Return " 1/4" Case 5 Return " 5/16" Case 6 Return " 3/8" Case 7 Return " 7/16" Case 8 Return " 1/2" Case 9 Return " 9/16" Case 10 Return " 5/8" Case 11 Return " 11/16" Case 12 Return " 3/4" Case 13 Return " 13/16" Case 14 Return " 7/8" Case 15 Return " 15/16" End Select End Function
hope this helps