.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DistanceToString

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
427 Views, 2 Replies

DistanceToString

How do I get the 0" to show in a distance string. i.e.; DistanceToString(240) -> 20' but I want it to show 20'-0"


Anyone?

 

Mike

2 REPLIES 2
Message 2 of 3
Keith.Brown
in reply to: Anonymous

Maybe it has something to do with your units in your drawing?  When i use the Autodesk.Autocad.Runtime.Convertor.DistanceToString it places the result into architectural units  (20'-0") but that is how I have my units of my drawing setup.

Message 3 of 3
_gile
in reply to: Keith.Brown

hi,

 

The overloaded DistanceToString() method take three arguments the value (double) the units format (DistanceUnitFormat) and the precision (double)

 

Converter.DistanceToString(240, DistanceUnitFormat.Architectural, 2)

 should work, but you have to look at the DIMZIN sysvar too (set to 1 to display the ending zeros).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost