I am looking for a better way to create a shadow line, than the poor attempt in coding that I have below. See image of what I am after.
I use this for creating a shadow line in an exterior elevation arch opening.
The code below will work for only one object at a time <arc or line>...I would like it to work for both within one pass.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; Shadow Line Polyline Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:PP ()
(PP-IT)
;;(while (= ARCH#LOOP "On")(PP-IT))
(princ)
)
(defun PP-IT (/ PL SSET SS ENTS STPT CNT NCNT PNT)
(prompt
"\n* Select Existing Arc to Offset..to become new \"Pline Shadow\" *"
)
;;(ARCH:F_S-VAR)
(setvar "cmdecho" 0)
;;(ARCH:CUSTOM_LAYERS-PATT)
(setq PL (getvar "plinetype"))
(setvar "plinetype" 2)
(setq SS (ssadd))
(setq SSET (ssget '((0 . "ARC,*LINE"))))
(setq PNT (getpoint "\n* Pick side to offset on *"))
(setvar "osmode" 0)
(command ".offset" "4.5" SSET (princ PNT) "")
(setq SSET (ssadd (entlast) SS))
(command "change" SSET "" "P" "LA" (getvar "clayer") "c" "8" "")
(setq SSET (ssadd (entlast) SS))
(progn
(if (= (cdr (assoc 0 (entget (ssname SSET 0)))) "LINE")
(cond
((< (distof (substr (getvar "acadver") 1 4)) 16.1)(command "pedit" SSET "y" "w" "8" ""))
((>= (distof (substr (getvar "acadver") 1 4)) 16.1)(command "pedit" SSET "w" "8" ""))
)
)
(if (or (= (cdr (assoc 0 (entget (ssname SSET 0)))) "POLYLINE")
(= (cdr (assoc 0 (entget (ssname SSET 0)))) "LWPOLYLINE")
)
(command "pedit" SSET "w" "8" "")
)
)
(setq SS (ssadd))
(cond
((= (cdr (assoc 0 (entget (ssname SSET 0)))) "ARC")
(cond
((< (distof (substr (getvar "acadver") 1 4)) 16.1)(command "pedit" SSET "y" ""))
((>= (distof (substr (getvar "acadver") 1 4)) 16.1)(command "pedit" SSET ""))
)
(setq CNT 0
NCNT 0
)
(setq SSET (ssadd (entlast) SS))
(if SSET
(progn
(repeat (sslength SSET)
(setq ENTS (entget (ssname SSET CNT))
STPT (cdr (assoc 40 ENTS))
)
(setq ENTS (vl-remove (assoc 43 ENTS) ENTS))
(entmod ENTS)
(if (= STPT 0)
(progn
(setq STPT 8)
(setq ENTS
(subst (cons 40 STPT)
(assoc 40 ENTS)
ENTS
)
)
(entmod ENTS)
(setq CNT (1+ CNT))
)
(progn
(setq NCNT (1+ NCNT))
(prompt
(strcat "\n" (itoa NCNT) " Polyline<s> already Zero.")
)
)
)
)
(prompt (strcat "\n* " (itoa CNT) " Polyline<s> Changed *"))
)
(prompt "\n* No Polylines Found *")
)
)
)
(setvar "plinetype" PL)
(princ "\n* \"Pline Shadow\" completed *")
;;(ARCH:F_R-VAR)
(princ)
)
Gary