Hi All,
I need some help with this lisp, i managed to modify it to do a triangle but i don't know what to write to make the 3 line to be a different color or layer. if some one could help i would appreciate it.
Thanks,
Brian
Code:
Tab Corner.lsp
;;function (myline mypt1 mypt2 mypt3) draw three lines
;;the first line goes from mypt1 to the y of mypt1 and the x of mypt2
;;the 2nd line goes from the y of mypt1 and the x of mypt2 to mypt2
;;the 3nd line goes from the x of mypt2 and the x of mypt2 to mypt1
;;the function dose not ask for the point so it can be called
;;from other programs
(defun myline (mypt1 mypt2 mypt3 / mypt4 acadObject acadDocument mSpace myobject)
(setq acadObject (vlax-get-acad-object))
(setq acadDocument (vla-get-ActiveDocument acadObject))
(setq mSpace (vla-get-ModelSpace acadDocument))
;;set up point three
(setq mypt3 (list (car mypt2) (cadr mypt1) (caddr mypt1)))
;;add the first line
(setq myobject (vla-addline
mspace
(vlax-3d-point mypt2)
(vlax-3d-point mypt3)
) ;_ end of vla-addline
) ;_ end of setq
;;if you need to set properties such as Layers, Linetypes, and Groups for
;;line one do it here
;;add the 2nd line
(setq myobject (vla-addline
mspace
(vlax-3d-point mypt3)
(vlax-3d-point mypt1)
) ;_ end of vla-addline
) ;_ end of setq
;;if you need to set properties such as Layers, Linetypes, and Groups for
;;line two do it here
;;add the 3nd line
(setq myobject (vla-addline
mspace
(vlax-3d-point mypt1)
(vlax-3d-point mypt2)
) ;_ end of vla-addline
) ;_ end of setq
;;if you need to set properties such as Layers, Linetypes, and Groups for
;;line three do it here
) ;_ end of defun
;;command tbc
;;Ask for the two line point and call myline
(defun c:tbc (/ mypt1 mypt2 mypt3)
(setq mypt2 (getpoint "Enter First Point"))
(setq mypt1 (getpoint "Enter 2ND Point" mypt2))
(myline mypt1 mypt2 mypt3)
) ;_ end of defun