.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Imperial input from user in Foot Inch .
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Ok, I think I figured it out. the integer required should be the denominator of the fraction of the precision required. For example, 1/4" precision would require the integer 4 and 1/256" precision would require the integer 256.
If you want to use the drawing units, just use:
Autodesk.AutoCAD.Runtime.Converter.DistanceToString(Dist as double) as string
Re: Imperial input from user in Foot Inch .
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I had a similar situation once. I found that the best solution was using Regular Expressions. That way you can parse whatever the user puts in your text box. In my case I restricted the units to inches, but they where free to write some like 10'-1 5/16", 5/32", 10" or 8.75".
Re: Imperial input from user in Foot Inch .
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Recently I used Converter.DistanceToString method and I would like to clarify two points for others.
1) Precision is integer from 0 to 8 (LUPREC equivalent). E.g. 1/4" is 2.
2) This method return value affected by AutoCAD variable DIMZIN. This variable controls suppression of zero. You have to temporary change it to your needs and then revers it back.




