TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Mark on September 26, 2003, 09:27:52 AM
-
It needs to do this:
prompt user for 2 points;
draw line between points
start extend command
use line to extend too
prompt user for "Select object to extend"
all I'm going to extend is a line nothing fancy.
-
Like this?
(defun mst-extend ()
(vl-cmdf "line" (getpoint (setq x (getpoint))) x "")
(vl-cmdf "extend" (entsel))
)
-
close.
but I don't want to have to select the line i just created, just the line to extend.
-
Like this?
(defun mst-extend2 ()
(setq line (vla-addline
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-object "AutoCAD.Application")))
(vlax-3d-point (getpoint (setq x (getpoint))))
(vlax-3d-point x)))
(vl-cmdf "extend" (vlax-vla-object->ename line))
(if (not (vlax-object-released-p line))
(vlax-release-object line)
)
)
BTW, My "junk" file is getting WAY to big. (I couldnt find anything i was looking for. :P )
EDIT: Released the line object.
-
Almost!! but close enough. :D
mine, based on yours.
(defun mst-extend2 (/ line)
(setq line (vla-addline
(vla-get-ModelSpace
(vla-get-ActiveDocument
(vlax-get-object "AutoCAD.Application")
)
)
(vlax-3d-point
(getpoint "\nSelect 2nd Point: "
(setq x (getpoint "\nSelect 1st Point: "))
)
)
(vlax-3d-point x)
)
)
(if line
(progn (vl-cmdf "extend" (vlax-vla-object->ename line) "")
(vlax-release-object line)
)
)
(princ)
)
notice the "" in the cmdf statement.
-
dosent work. :?
Wait, you wanted to extend the line you just drew? (that doesnet make anysense!) Ohhh i get what your after ...i think. You want to extend aother line to this line you just drew. (Now that would change things a bit.) Sorry, i misunderstood ya.
Glad it works.
-
Glad it works
me too!!