Help with a lisp routine to add a 12" line to this routine
Code:
;get points to locate centerline of header
(prompt "\nSelect two points for Rim line: ")
(command "_.line" pause pause "")
(setq tmpPnt1 (cdr (assoc 10 (entget (entlast)))))
(setq tmpPnt2 (cdr (assoc 11 (entget (entlast)))))
(COMMAND "_.erase" "L" "")
(setvar "osmode" 0)
(command "_.line"
(polar tmpPnt1 (angle tmpPnt1 tmpPnt2) (* mtScaleFactor 1.25))
(polar tmpPnt2 (+ (angle tmpPnt1 tmpPnt2) PI) (* mtScaleFactor 1.25))
""
This part of the lisp draws a line then depending on the dimscale it retracts the 2 ends closer to the center. I was wondering if i could get some help making the lines extend 12" i've tried messing with the scale factors ( IE 1.25 - 1.00 -.25) I seem to be missing something to go in a positive direction versus negative.
Thanks for the help in advance ;)
Re: Help with a lisp routine to add a 12" line to this routine
Quote:
retracts the 2 end
or
Quote:
making the lines extend
which one? or option for both?
Re: Help with a lisp routine to add a 12" line to this routine
Quote:
Originally Posted by
pbejse
or
which one? or option for both?
Let me explain it a little better......The Lisp draws a line between 2 points and depending on the scale factor (typically dimscale 48 for example) it will stop the line 3" short on either end of the 2 points picked. (for dimscale 96 it will stop 1-1/2" short).
What I am trying to achieve is to extend the line 12" past (at dimscale 48) the 2 points picked. The original "mtscale factor" was set at .0625 for the 3" variable. I adjusted it to 1.25 but it doesnt seem to work. It seems to be referencing the the "actual distance between the 2 points" and messes with the whole line offset. Sometimes it extends too far past the 2 points or stops short by a lot. I hope this explains things a little better. Thanks for the response. I am glad someone is looking ;)
Re: Help with a lisp routine to add a 12" line to this routine
Use the midpoint for extent or reduce length
Code:
(defun c:LenghtByFact ( / js n dxf_ent dxf_10 dxf_11 mid k dlt_10 dlt_11 nwdxf_10 nwdxf_11)
(princ "\nSelect lines for reduce or extent length with a factor. ")
(setq js (ssget '((0 . "LINE"))))
(cond
(js
(initget 3)
(setq k (getreal "\nGive the factor: "))
(repeat (setq n (sslength js))
(setq
dxf_ent (entget (ssname js (setq n (1- n))))
dxf_10 (cdr (assoc 10 dxf_ent))
dxf_11 (cdr (assoc 11 dxf_ent))
mid
(mapcar '*
(mapcar '+ dxf_10 dxf_11)
'(0.5 0.5 0.5)
)
dlt_10 (mapcar '* (mapcar '- dxf_10 mid) (list k k k))
dlt_11 (mapcar '* (mapcar '- dxf_11 mid) (list k k k))
nwdxf_10 (mapcar '+ mid dlt_10)
nwdxf_11 (mapcar '+ mid dlt_11)
dxf_ent (subst (cons 10 nwdxf_10) (assoc 10 dxf_ent) dxf_ent)
dxf_ent (subst (cons 11 nwdxf_11) (assoc 11 dxf_ent) dxf_ent)
)
(entmod dxf_ent)
)
)
)
(prin1)
)