AutoCAD 2000/2000i/2002 Archive

AutoCAD 2000/2000i/2002 Archive

Reply
*Renaud, David
Message 1 of 7 (275 Views)

Convert decimal feet to Fractions

275 Views, 6 Replies
03-14-2002 09:06 PM
Hey,

I have several numbers in decimal, for ex. 31.23 feet. I want to
automatically convert the numbers to fractional feet, inches and 1/4
inches (31' 2 3/4").

I can convert and DDEDIT them myself, but I want the machine to do it.
Does anyone know a method? Prefferably within Acad2002, but I have Excel
at my disposal as well. Maybe some way with dimension styles???

Thanks!
David
*Reichle, Don
Message 2 of 7 (275 Views)

Re: Convert decimal feet to Fractions

03-15-2002 12:39 AM in reply to: *Renaud, David
Am I missing something, or is this what DDUNITS is for? Or
DDIM>Annotation>Primary Units>Units>Engineering is the format I think you
want.
*Reichle, Don
Message 3 of 7 (275 Views)

Re: Convert decimal feet to Fractions

03-15-2002 12:41 AM in reply to: *Renaud, David
Oh I forgot. While in Units set your Precision to the appropriate level.
*Renaud, David
Message 4 of 7 (275 Views)

Re:

03-15-2002 12:54 AM in reply to: *Renaud, David
Well, my numbers are text objects only (in Autocad). So setting units
doesn't do a thing for me, it's still just a hunk of text. I thought
maybe I could do it by getting the text in as the dimension value
somehow, but I couldn't figure out how to do it short of offsetting a
line for each number, dimensioning the offsetted lines, exploding the
dimensions to get at the text, moving and aligning, what a pain. Excel
came close to doing what I wanted, but 31.23' would convert to 31 1/4",
not 31' 2-3/4". Rats. I ended up doing it all by hand in the end. But
I'm still interested in an auto method if someone can think of one ...

D
*Turvill, Paul
Message 5 of 7 (275 Views)

Re:

03-15-2002 01:43 AM in reply to: *Renaud, David
A little LISP would go a long way, here. That's precisely what the (atof)
and (rtos) functions are designed for.

(rtos (atof "31.23") 5 4)
returns 31 1/4 ...

(rtos (* 12 (atof "31.23")) 4 4)
returns 31'-2 3/4"

...but it would have to be embedded in sufficient code to extract the
numeric string from the rest of your text. If you're not fluent in LISP,
you'll find considerable help with this process in the Customization group.
___

"David Renaud" wrote in message
news:3C92272D.55513B29@reiengineering.com...
> Well, my numbers are text objects only (in Autocad). So setting units
> doesn't do a thing for me, it's still just a hunk of text. I thought
> maybe I could do it by getting the text in as the dimension value
> somehow, but I couldn't figure out how to do it short of offsetting a
> line for each number, dimensioning the offsetted lines, exploding the
> dimensions to get at the text, moving and aligning, what a pain. Excel
> came close to doing what I wanted, but 31.23' would convert to 31 1/4",
> not 31' 2-3/4". Rats. I ended up doing it all by hand in the end. But
> I'm still interested in an auto method if someone can think of one ...
>
> D
*Renaud, David
Message 6 of 7 (275 Views)

Re:

03-15-2002 01:52 AM in reply to: *Renaud, David
hey thanks, Paul,

As it turns out the text bits are -just- the number, so I think it will
work, I will try.

I am just fluent enough in lisp to be able to open a file and -sort of-
tell what is going on. I will head to customization if I can't get this
to go.

Thanks again,
David
*Turvill, Paul
Message 7 of 7 (275 Views)

Re:

03-15-2002 01:58 AM in reply to: *Renaud, David
You're welcome. Glad to help.
___

"David Renaud" wrote in message
news:3C9234DC.F99B9A8C@reiengineering.com...
> hey thanks, Paul,
>
> As it turns out the text bits are -just- the number, so I think it will
> work, I will try.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.