Author Topic: decimal to architec and other UNIT system  (Read 8855 times)

0 Members and 1 Guest are viewing this topic.

DEVITG

  • Bull Frog
  • Posts: 479
decimal to architec and other UNIT system
« on: February 21, 2004, 04:40:07 PM »
Hi all .

Has I born in a metric country, I allways use decimal as UNIT system.

But seldom I need to let the user to choose the unit system he/she want to use.

How it can be done by LISP :oops:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

daron

  • Guest
decimal to architec and other UNIT system
« Reply #1 on: February 21, 2004, 05:56:03 PM »
Not sure of the question, but have you tried (setvar 'luprec 4)?

DEVITG

  • Bull Frog
  • Posts: 479
not luprec
« Reply #2 on: February 21, 2004, 06:10:59 PM »
Hi daron , luprec hold the decimal after the decimal point
What I'm looking for is to be able to change the way units can be input.

The drawing could be >

Architectural  [ 12' 10 1/4"]
Decimal [123.4589]
engeenirring [12' -0.0005"]
Fractional [0 1/8"]
Scientific [ 10 e 2]

It can be set by the UNITS command

How it can be set from a lisp.
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

daron

  • Guest
decimal to architec and other UNIT system
« Reply #3 on: February 21, 2004, 06:36:22 PM »
try (setvar 'lunits 4). I'm only throwing out what comes to mind as I am not currently on a machine with autocad. I realized after I posted that what I wrote wouldn't be the answer, ah well.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
decimal to architec and other UNIT system
« Reply #4 on: February 21, 2004, 06:46:58 PM »
lunits is the answer ....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

DEVITG

  • Bull Frog
  • Posts: 479
that is
« Reply #5 on: February 21, 2004, 07:04:09 PM »
Hi Daron and Keith that is what I was lookin for.

Thanks again.
 :lol:  :)  :D  :wink:  :!:  :!:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

rude dog

  • Guest
decimal to architec and other UNIT system
« Reply #6 on: February 21, 2004, 07:30:25 PM »
Code: [Select]

(defun c:sdim ()
(initget 7)
(setq ds (getint "\nEnter <1> for Scientfic <2> for Decimal <3> Engineering <4> Architectural"))
(command "dimunit" ds "")
)
(princ)

I know someone else out there can improve on this.....

DEVITG

  • Bull Frog
  • Posts: 479
ok and now hoe I do .....
« Reply #7 on: February 21, 2004, 07:34:16 PM »
:oops:

As I told you before , I allways use decimal .
If LUNITS is set to 4 how I must input the values
I only can input 12'10
But I can not input 12'10"3/4
How I shal key in the value??? :?:  :oops:  :oops:  :cry:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

DEVITG

  • Bull Frog
  • Posts: 479
dimunits + lunits
« Reply #8 on: February 21, 2004, 07:38:19 PM »
Hi Rude Dog
 Nice routine , but I change the LUNITS just to input values , maybe I need to change the  DIMUNITS too so the user will be able to DIM in architectural.
Thanks for it
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Anonymous

  • Guest
decimal to architec and other UNIT system
« Reply #9 on: February 21, 2004, 07:55:14 PM »
I think this will do it...

Code: [Select]

(defun C:UU ()
(initget 7)
(setq UA (getint "\nEnter <1> for Scientfic <2> for Decimal <3> Engineering <4> Architectural"))
(setvar UA)
)
(princ)


rude dog

  • Guest
decimal to architec and other UNIT system
« Reply #10 on: February 21, 2004, 07:58:49 PM »
If it is wrong  it was me RDOG the unknown guest....
Hey DEVITG...this place is the best for any code questions me being a newbie myself I am astounded daily by some of these peoples creativity and knowledge....Enjoy your stay

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
decimal to architec and other UNIT system
« Reply #11 on: February 21, 2004, 08:35:48 PM »
Your distance is 12'-10 3/4" which is equal to 154.75 in decimal or 154 3/4"

To enter a value when LUNITS is set to 4 (architectural) do it this way:

FEET'-INCHES FRACTIONS"
or
INCHES FRACTIONS"

Note the location of the single and double tic marks for the feet and inches designation.

I hope you understand now....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

DEVITG

  • Bull Frog
  • Posts: 479
no fractions allowed
« Reply #12 on: February 21, 2004, 08:57:14 PM »
Hi keith .
I'm missing something
I can type 12' -10"
but I can not put the fractions
Quote
Specify radius of circle or [Diameter] <0'-10">: 0'-10"3/4

Requires numeric radius, point on circumference, or "D".
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
decimal to architec and other UNIT system
« Reply #13 on: February 21, 2004, 09:16:54 PM »
You have to put the inch mark AFTER the fraction and a space between the fraction and full inches as I showed in the above example...

12'-10 3/4"
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

DEVITG

  • Bull Frog
  • Posts: 479
no way tu put fraction
« Reply #14 on: February 22, 2004, 09:33:50 AM »
Keith , please apologize me for so insistent.

Set lunits to 4 , when I put the 0'12-10 it is OK , but when I type an space after the 10 to put the fraction it do an enter and send me a error messg.

Quote
Specify radius of circle or [Diameter] <1'-0">: 0'-103/4"

Requires numeric radius, point on circumference, or "D".

Specify radius of circle or [Diameter] <1'-0">: 0'-10"3/4

Requires numeric radius, point on circumference, or "D".

Specify radius of circle or [Diameter] <1'-0">: 0'-10



Only the last one is ok but I can not put the fractios , what I'm doing wrong???? :oops:  :oops:  :cry:  :cry:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

rude dog

  • Guest
decimal to architec and other UNIT system
« Reply #15 on: February 22, 2004, 10:14:41 AM »
Command: l LINE Specify first point: 0,0,0

Specify next point or [Undo]: 12'10-3/4

Command: l LINE Specify first point:
Specify next point or [Undo]: 10

Command: LINE
Specify first point:
Specify next point or [Undo]: 10-3/8

Command: l LINE Specify first point:
Specify next point or [Undo]: 1'0-7/8

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
decimal to architec and other UNIT system
« Reply #16 on: February 22, 2004, 11:24:52 AM »
If you are using the input in a program using the GETSTRING function you must use it in the following manner....

Code: [Select]

(getstring T "put prompt here")


Then you can enter it with a space,  or you alternatively can enter it as RD has shown above OR you can neter it as a sort of hybridlike so...

12'10.75"
12'-10.75"
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ELOQUINTET

  • Guest
decimal to architec and other UNIT system
« Reply #17 on: February 23, 2004, 08:14:05 AM »
kind of related to this i would like a way to quickly toggle between architectural and fractional units. i am in fabricational so we use fractional but when i'm doing layout work from architectural i use architectural. what would a button to do this look like?

daron

  • Guest
decimal to architec and other UNIT system
« Reply #18 on: February 23, 2004, 08:31:57 AM »
I think RD's example is the answer. You separate the inches from fractions by a hypen "-". You don't need the inch mark at all. It is implied.

ELOQUINTET

  • Guest
decimal to architec and other UNIT system
« Reply #19 on: February 23, 2004, 10:09:23 AM »
"fabricational" is that a word? i figured it out guys nevermind

DEVITG

  • Bull Frog
  • Posts: 479
togle button for lunit
« Reply #20 on: February 23, 2004, 01:05:46 PM »
Please put it in a  button  macro .

Code: [Select]


(if (= (getvar "lunits" ) 4 ) (setvar "lunits" 5 ) (Setvar "lunits" 4))



If you only use fract and archi .

"fabricational"  is a word to name the drafter make thing to be fabricated.
 :wink:  :lol:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

ELOQUINTET

  • Guest
decimal to architec and other UNIT system
« Reply #21 on: February 23, 2004, 09:51:07 PM »
i was getting ahead of myself. if you look i used fractional shortly after fabrication making it fabricational. dyslexia  :roll:

Serge J. Gianolla

  • Guest
decimal to architec and other UNIT system
« Reply #22 on: February 24, 2004, 12:23:28 AM »
Devitg,
If you are as familiar with imperial units as I am [which is pretty much close to nothing], you might have stumbled on a puzzling thing. When you draw a line say 12'10-3/4

Command: LINE Specify first point:
Specify next point or [Undo]: 12'10-3/4
then list the line you will notice a different format of the length is given

          Length =12'-10 3/4" ,  Angle in XY Plane =    308
                  Delta X =7'-11 15/16", Delta Y = -10'-1 7/16", Delta Z =

This happens when your UNITMODE is set on 0, when set on 1
 Length =12'10-3/4" ,  Angle in XY Plane =    308
                  Delta X =7'11-15/16", Delta Y = -10'1-7/16", Delta Z =
that might help when debugging.