Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Equations

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
afisher
683 Views, 12 Replies

Equations

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.

12 REPLIES 12
Message 2 of 13
pendean
in reply to: afisher

Start HELP in AutoCAD and in the search box type:

Use the Command Prompt Calculator
Message 3 of 13
GrantsPirate
in reply to: afisher

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
EXPERT ELITE MEMBER
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.

Message 4 of 13
afisher
in reply to: afisher

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.

Message 5 of 13
dany_rochefort
in reply to: afisher

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

Message 6 of 13

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
EXPERT ELITE MEMBER
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.

Message 7 of 13
dany_rochefort
in reply to: afisher

Totally agree with you, i wouldnt call those Solutions either. Using a personal calculator is quicker then writing algebriac notation a the command prompt.

Message 8 of 13
afisher
in reply to: dany_rochefort

Dany,

 

It looks like your lisp routine is only for 1/3.  Is this true?

Message 9 of 13
dany_rochefort
in reply to: afisher

Yes, 1/3 of the known length...
Message 10 of 13
dany_rochefort
in reply to: afisher

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...

Message 11 of 13
Kent1Cooper
in reply to: afisher


@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.

Kent Cooper, AIA
Message 12 of 13
dany_rochefort
in reply to: afisher

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))
)

Tags (1)
Message 13 of 13
GrantsPirate
in reply to: Kent1Cooper


@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
EXPERT ELITE MEMBER
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.

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

Post to forums  

Autodesk Design & Make Report

”Boost