VisDak Posted May 21, 2009 Posted May 21, 2009 Hi All, Please help me to fasten my work, my superior want me to do with multi-services layout (MEP combined services) by overlay the Individual layouts (Xref files) but he want to be specify the crossing services/lines drawing what will be the higher and lower services by creating a hidden line on the crossing lines, kindly see image so that it will be clear to you, The duct and Pipe line are on crossing i want my pipe to be on lower than the Duct works, I'll trim/break then replace the trim line to hidden line, it must be 2 line to be replace on the trimmed line, 1 is hidden and the other one is continious lines by different layers so that if they need the pipes line drawings only i will off the hidden and change to continious line again, Is it possible to have an Lsp that automatically break the line and replace with 2 line (continious and hidden with different layers) then the continious line will automatically off so that only the hidden line will be represent, If you have Lsp like i needed please help me, thanks to all, Quote
Commandobill Posted May 21, 2009 Posted May 21, 2009 Here you go (defun c:bline ( / ) (setq obj (entsel "Select object: ")) (setq pt2 (getpoint "Specify second break point: ")) (setq pt1 (cadr obj)) (command "break" pt1 pt2) (command "line" pt1 pt2 "") (setq l1name (vlax-ename->vla-object (entlast))) (vla-put-linetype l1name "HIDDEN") (vla-put-layer l1name "C-ANNO-NOTE") ;<----INSERT NEW LAYER (command "line" pt1 pt2 "") (setq l2name (vlax-ename->vla-object (entlast))) (vla-put-linetype l2name "CONTINUOUS") (vla-put-layer l2name "C-ANNO-TEXT") ;<-----INSERT NEW LAYER (princ) ) Quote
Lee Mac Posted May 21, 2009 Posted May 21, 2009 Or: [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:brk [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] *error* vlst ovar cEnt pt1 pt2 cObj bPts nlin[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] *error* [b][color=RED]([/color][/b]msg[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] ovar [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]setvar[/color][/b] vlst ovar[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] msg [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"Function cancelled"[/color][/b] [b][color=#ff00ff]"quit / exit abort"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] [b][color=#ff00ff]"\n<< Error: "[/color][/b] msg [b][color=#ff00ff]" >>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"<< Function Cancelled >>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"LTYPE"[/color][/b] [b][color=#ff00ff]"HIDDEN"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-load[/color][/b] [b][color=#ff00ff]"HIDDEN"[/color][/b] [b][color=#ff00ff]"acad.lin"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-Acad-Object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]zerop[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-activespace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-mspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=Blue]:vlax-true[/color][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-paperspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] vlst [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"CMDECHO"[/color][/b] [b][color=#ff00ff]"OSMODE"[/color][/b][b][color=RED])[/color][/b] ovar [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]getvar[/color][/b] vlst[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=#ff00ff]"CMDECHO"[/color][/b] [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] cEnt [b][color=RED]([/color][/b][b][color=BLUE]entsel[/color][/b] [b][color=#ff00ff]"\nSelect Line: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] cEnt[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"LINE"[/color][/b] [b][color=#ff00ff]"POLYLINE"[/color][/b] [b][color=#ff00ff]"LWPOLYLINE"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt1 [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] [b][color=#ff00ff]"\nSelect First Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt2 [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] [b][color=#ff00ff]"\nSelect Second Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=#ff00ff]"OSMODE"[/color][/b] [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] cObj [b][color=RED]([/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] cEnt[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] bPts [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getClosestPointto[/color][/b] cObj x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] pt1 pt2[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]command[/color][/b] [b][color=#ff00ff]"_break"[/color][/b] cEnt [b][color=#ff00ff]"_F"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] bPts[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] bPts[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] nlin [b][color=RED]([/color][/b][b][color=BLUE]vla-addline[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]vlax-3D-point[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] bPts[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-3D-point[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] bPts[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"LTYPE"[/color][/b] [b][color=#ff00ff]"HIDDEN"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-put-linetype[/color][/b] nlin [b][color=#ff00ff]"HIDDEN"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> Hidden Linetype Could not be Found <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> Points not Selected <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> Incorrect Line Selection <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]setvar[/color][/b] vlst ovar[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] Quote
Commandobill Posted May 22, 2009 Posted May 22, 2009 Of course i waited all day to write that code to see if anyone else was going to but... Lee a few things about your code. (if (not (tblsearch "LTYPE" "HIDDEN")) (vla-load (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))"HIDDEN" "ACAD.LIN")) Now it makes a hidden line. I really liked the idea of checking to see if it was a line polyline lwpolyline. (setvar "OSMODE" 0) (setq cObj (vlax-ename->vla-object (car cEnt))) (setq bPts (mapcar (function (lambda (x) (vlax-curve-getClosestPointto cObj x))) (list pt1 pt2))) i dont get why you wrote this in... break automatically does this. Also he asked for 2 lines on 2 different layers 1 hidden 1 continuous. I hope you dont think im assaulting you. Personally i learn alot from the codes you write. I just thought u could use some critisizm. Quote
Lee Mac Posted May 22, 2009 Posted May 22, 2009 Thanks Bill, I'll take all the criticism I can get (if (not (tblsearch "LTYPE" "HIDDEN")) (vla-load (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object)))"HIDDEN" "ACAD.LIN")) Now it makes a hidden line. OK, now this was a schoolboy error, just rushing on my part (I already have the "HIDDEN" linetype loaded, so it doesn't cause an error I would notice upon testing... but thats no excuse.. I really liked the idea of checking to see if it was a line polyline lwpolyline. Thanks (setvar "OSMODE" 0) (setq cObj (vlax-ename->vla-object (car cEnt))) (setq bPts (mapcar (function (lambda (x) (vlax-curve-getClosestPointto cObj x))) (list pt1 pt2))) i dont get why you wrote this in... break automatically does this. I haven't got the AutoCAD experience to know that break automatically uses the getClosestPointto, so I just made sure they were points on the line anyway As for the layers and other lines - tbh, I didn't completely read the request too carefully, I just looked at the pic Quote
Lee Mac Posted May 22, 2009 Posted May 22, 2009 (edited) Ok, so with the linetype mistake changed... (I still want to keep the getClosestPointto in there, just for safety ) (defun c:brk (/ *error* vlst ovar cEnt pt1 pt2 cObj bPts nlin) (vl-load-com) (defun *error* (msg) (if ovar (mapcar 'setvar vlst ovar)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\n<< Error: " msg " >>")) (princ "<< Function Cancelled >>")) (princ)) (setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)) spc (if (zerop (vla-get-activespace doc)) (if (= (vla-get-mspace doc) :vlax-true) (vla-get-modelspace doc) (vla-get-paperspace doc)) (vla-get-modelspace doc))) (if (not (tblsearch "LTYPE" "HIDDEN")) (vla-load (vla-get-Linetypes doc) "HIDDEN" "acad.lin")) (setq vlst '("CMDECHO" "OSMODE") ovar (mapcar 'getvar vlst)) (setvar "CMDECHO" 0) (if (and (setq cEnt (entsel "\nSelect Line: ")) (member (cdr (assoc 0 (entget (car cEnt)))) '("LINE" "POLYLINE" "LWPOLYLINE"))) (if (and (setq pt1 (getpoint "\nSelect First Point: ")) (setq pt2 (getpoint "\nSelect Second Point: "))) (progn (setvar "OSMODE" 0) (setq cObj (vlax-ename->vla-object (car cEnt))) (setq bPts (mapcar (function (lambda (x) (vlax-curve-getClosestPointto cObj x))) (list pt1 pt2))) (command "_break" cEnt "_F" (car bPts) (cadr bPts)) (setq nlin (vla-addline spc (vlax-3D-point (car bPts)) (vlax-3D-point (cadr bPts)))) (if (tblsearch "LTYPE" "HIDDEN") (vla-put-linetype nlin "HIDDEN") (princ "\n<!> Hidden Linetype Could not be Found <!>"))) (princ "\n<!> Points not Selected <!>")) (princ "\n<!> Incorrect Line Selection <!>")) (mapcar 'setvar vlst ovar) (princ)) Edited October 27, 2023 by Lee Mac 1 Quote
VisDak Posted June 2, 2009 Author Posted June 2, 2009 Thanks Lee & Commandobill Both of your Lisp are helpful, and sorry for the late response due to busy on schedule works thank again pals Cheers Quote
Freerefill Posted June 2, 2009 Posted June 2, 2009 Look still hereDHline v.1.0 !! ;-) Oh wow... that is SLICK! Very incredible! Quote
leonucadomi Posted October 27, 2023 Posted October 27, 2023 On 5/22/2009 at 7:40 AM, Lee Mac said: Ok, so with the linetype mistake changed... (I still want to keep the getClosestPointto in there, just for safety ) [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:brk [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] *error* vlst ovar cEnt pt1 pt2 cObj bPts nlin[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vl-load-com[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] *error* [b][color=RED]([/color][/b]msg[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] ovar [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]setvar[/color][/b] vlst ovar[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] msg [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"Function cancelled"[/color][/b] [b][color=#ff00ff]"quit / exit abort"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]strcat[/color][/b] [b][color=#ff00ff]"\n<< Error: "[/color][/b] msg [b][color=#ff00ff]" >>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"<< Function Cancelled >>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] doc [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-Acad-Object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]zerop[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-activespace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-mspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=Blue]:vlax-true[/color][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-paperspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-modelspace[/color][/b] doc[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]not[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"LTYPE"[/color][/b] [b][color=#ff00ff]"HIDDEN"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-load[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-Linetypes[/color][/b] doc[b][color=RED])[/color][/b] [b][color=#ff00ff]"HIDDEN"[/color][/b] [b][color=#ff00ff]"acad.lin"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] vlst [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"CMDECHO"[/color][/b] [b][color=#ff00ff]"OSMODE"[/color][/b][b][color=RED])[/color][/b] ovar [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]getvar[/color][/b] vlst[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=#ff00ff]"CMDECHO"[/color][/b] [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] cEnt [b][color=RED]([/color][/b][b][color=BLUE]entsel[/color][/b] [b][color=#ff00ff]"\nSelect Line: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]member[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]0[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] cEnt[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#ff00ff]"LINE"[/color][/b] [b][color=#ff00ff]"POLYLINE"[/color][/b] [b][color=#ff00ff]"LWPOLYLINE"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]and[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt1 [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] [b][color=#ff00ff]"\nSelect First Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] pt2 [b][color=RED]([/color][/b][b][color=BLUE]getpoint[/color][/b] [b][color=#ff00ff]"\nSelect Second Point: "[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=#ff00ff]"OSMODE"[/color][/b] [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] cObj [b][color=RED]([/color][/b][b][color=BLUE]vlax-ename->vla-object[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] cEnt[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] bPts [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-curve-getClosestPointto[/color][/b] cObj x[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] pt1 pt2[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]command[/color][/b] [b][color=#ff00ff]"_break"[/color][/b] cEnt [b][color=#ff00ff]"_F"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] bPts[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] bPts[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] nlin [b][color=RED]([/color][/b][b][color=BLUE]vla-addline[/color][/b] spc [b][color=RED]([/color][/b][b][color=BLUE]vlax-3D-point[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] bPts[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-3D-point[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cadr[/color][/b] bPts[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]tblsearch[/color][/b] [b][color=#ff00ff]"LTYPE"[/color][/b] [b][color=#ff00ff]"HIDDEN"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-put-linetype[/color][/b] nlin [b][color=#ff00ff]"HIDDEN"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> Hidden Linetype Could not be Found <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> Points not Selected <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b] [b][color=#ff00ff]"\n<!> Incorrect Line Selection <!>"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]setvar[/color][/b] vlst ovar[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] Quote
leonucadomi Posted October 27, 2023 Posted October 27, 2023 Master Leee . how can I use this code? Quote
Lee Mac Posted October 27, 2023 Posted October 27, 2023 24 minutes ago, leonucadomi said: Master Leee . how can I use this code? The update to the forum software had caused the BBCode formatting tags to become visible - I've now updated my earlier post to remove these. However, this code is incredibly old! 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.