Is there a way to use equations in AutoCAD when drafting lines, arcs, offset, etc? For example, I have a line which is 4". I want to draw a line which is 1/3 of that known length. Rather than calculating it on a calculator then coming back to AutoCAD, can it be done in AutoCAD? Of course it would be nice if I could just type it into the input.
Solved! Go to Solution.
Solved by GrantsPirate. Go to Solution.
Solved by pendean. Go to Solution.
At the command line type
(/ 4.0 3)
Notice the 4.0 and not 4, otherwise you will get a rounded answer.
Multiply would be
(* 4.0 3)
as an example
GrantsPirate
Piping and Mech. Designer
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.
Dean and GrantsPirate,
Both of these methods will be very useful. They both require one extra step to initiate than I was anticipating, but is still better than picking up a calculator.
Hey bro, i was in a good mood so I wrote you a Lisp command that will do the work for you. It's not too sophisticated but it will do the job just fine.
Hopefully you know how to load a Lisp command ?! Once loaded, you can invoke to command using XX on the keyboard.
(defun c:xx (/ len)
(princ "\nDividing Length by 1/3")
(setq len (getdist "\nEnter a length or pick points: "))
(/ len 3)
)
;Dany Rochefort
; August 28th,2015
; Québec City Canada
Send some Kudos my way if it works out for you... Cheers
Just to clarify my solution, start the line command, pick a point, pull you cursor the direction you want to go, then (/ 4.0 3), enter.
And for multiplication the .0 isn't needed, just for division. (* 4 3)
GrantsPirate
Piping and Mech. Designer
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.
Totally agree with you, i wouldnt call those Solutions either. Using a personal calculator is quicker then writing algebriac notation a the command prompt.
But you can modify it to anything you like...
Here is one for 1/4
(defun c:yy (/ len)
(princ "\nDividing Length by 1/4")
(setq len (getdist "\nEnter a length or pick points: "))
(/ len 4)
)
Invoke command using YY at the keyboard...
@Anonymous wrote:
Is there a way to use equations in AutoCAD when drafting lines, arcs, offset, etc? For example, I have a line which is 4". I want to draw a line which is 1/3 of that known length. ....
In the case of something as simple as a ratio of integers, you can do without the AutoLisp division (/) function, because AutoCAD recognizes fractions of any numerator/denominator relationship [as long as they're both whole numbers] -- i.e. the numerator can even be larger than the denominator, and it will still know what you're talking about. You can just pick a start point, aim the cursor in the direction you want to go, and type
4/3
And you don't even need to ensure that one of them is a real number [the 4.0 in Post 3 et al] -- in fact you can't, because it won't recognize it as a fraction that way.
This one will divide your known length by anything you want. Use ZZ to invoke with the keyboard.
(defun c:ZZ( / AA BB)
(setq AA (getdist "ENTER KNOWN LENGTH "))
(setq BB (getreal "DIVIDE SEGMENT BY ? "))
(setq CC (/ AA BB))
)
@Kent1Cooper wrote:
@Anonymous wrote:
Is there a way to use equations in AutoCAD when drafting lines, arcs, offset, etc? For example, I have a line which is 4". I want to draw a line which is 1/3 of that known length. ....
In the case of something as simple as a ratio of integers, you can do without the AutoLisp division (/) function, because AutoCAD recognizes fractions of any numerator/denominator relationship [as long as they're both whole numbers] -- i.e. the numerator can even be larger than the denominator, and it will still know what you're talking about. You can just pick a start point, aim the cursor in the direction you want to go, and type
4/3
And you don't even need to ensure that one of them is a real number [the 4.0 in Post 3 et al] -- in fact you can't, because it won't recognize it as a fraction that way.
In the case of 12.2 / 2.5 you would need to enter as 122/25 as decimals won't work in this manner.
GrantsPirate
Piping and Mech. Designer
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.