| Author |
Message |
aosterday
Guest
|
Posted:
Wed Apr 06, 2005 12:37 am Post subject:
Line Lisp routine |
|
|
I have a routine that draws a line between point 1 and point 2, then inserts a block at point 2. I now need to have the line at point 1 to extend past the point by a certain percentage. Any help I can get is much appreciated.
|
|
| Back to top |
|
 |
Jeff Mishler
Guest
|
Posted:
Wed Apr 06, 2005 12:48 am Post subject:
Re: Line Lisp routine |
|
|
(setq proportion 0.1);10% longer
(setq initial_length (distance pt1 pt2))
(setq length2add (* initial_length proportion))
(setq newpt1 (polar pt1 (angle pt2 pt1) length2add))
--
Jeff
check out www.cadvault.com
"aosterday" <nospam@address.withheld> wrote in message
news:1417266.1112733504694.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | I have a routine that draws a line between point 1 and point 2, then
inserts a block at point 2. I now need to have the line at point 1 to
extend past the point by a certain percentage. Any help I can get is much
appreciated. |
|
|
| Back to top |
|
 |
Kent Cooper, AIA
Guest
|
Posted:
Wed Apr 06, 2005 1:06 am Post subject:
Re: Line Lisp routine |
|
|
Assuming:
- you always want the line extended by the same percentage of the overall
line length, say 10%, beyond point 1, and
- your points are called pt1 and pt2 in your routine;
after inserting the block, you could do something like:
(command "lengthen" "de" (* (distance pt1 pt2) 0.1) pt1 "")
Change the 0.1 for a different percentage, and the pt1 and pt2 for the names
you use in your routine. And this assumes there's not likely to be
something else that it might find at pt1.
--
Kent Cooper
"aosterday" wrote...
| Quote: | I have a routine that draws a line between point 1 and point 2, then
inserts a block at point 2. I now need to have the line at point 1 to
extend past the point by a certain percentage. Any help I can get is much
appreciated. |
|
|
| Back to top |
|
 |
aosterday
Guest
|
Posted:
Wed Apr 06, 2005 1:10 am Post subject:
Re: Line Lisp routine |
|
|
| Thank you Jeff, that worked perfectly |
|
| Back to top |
|
 |
Kent Cooper, AIA
Guest
|
Posted:
Wed Apr 06, 2005 1:11 am Post subject:
Re: Line Lisp routine |
|
|
....then it needs something to Change the line to the newpt1 location....
--
Kent Cooper
"Jeff Mishler" wrote...
| Quote: | (setq proportion 0.1);10% longer
(setq initial_length (distance pt1 pt2))
(setq length2add (* initial_length proportion))
(setq newpt1 (polar pt1 (angle pt2 pt1) length2add)) |
|
|
| Back to top |
|
 |
Kent Cooper, AIA
Guest
|
Posted:
Wed Apr 06, 2005 1:14 am Post subject:
Re: Line Lisp routine |
|
|
....or if you had in mind to do this prior to drawing the line in the first
place, that works....
--
Kent Cooper
"Kent Cooper, AIA" wrote...
| Quote: | ...then it needs something to Change the line to the newpt1 location....
--
Kent Cooper
"Jeff Mishler" wrote...
(setq proportion 0.1);10% longer
(setq initial_length (distance pt1 pt2))
(setq length2add (* initial_length proportion))
(setq newpt1 (polar pt1 (angle pt2 pt1) length2add)) |
|
|
| Back to top |
|
 |
|
|
|
|