Message 1 of 13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings,
I have this older LISP that worked on older AutoCAD versions but once upgraded to AutoCAD 2019 it is no longer working.
What is causing this to happen?
Appreciate any help with this.
Thank you
;------------------------------------------------------------------------------
; DIA.LSP - Draws lines on both sides of the selected centerline
; using half the given diameter value.
(princ "Please wait ... Loading ")
(defun C:DIA ()
; Function to change the properties of the LAST (newest) item created.
(defun FIXUP ()
(setq ss (entget (entlast)))
(setq ss (subst (cons 8 (getvar "clayer")) (assoc 8 ss) ss)) ; LAyer
(setq ss (subst (cons 6 "BYLAYER") (assoc 6 ss) ss)) ; LType
(setq ss (subst (cons 62 256) (assoc 62 ss) ss)) ; Color
(entmod ss)
) ; finish FIXUP
(setq os (getvar "osmode")) (setvar "osmode" 0)
(setq e (entsel "Select centerline: ")) (setvar "osmode" os)
(if (/= e nil)
(if (= "LINE" (cdr (assoc 0 (setq L (entget (car e))) )))
(progn
(setq cont t)
(while cont
(initget (+ 2 4)) (setq d (getreal "\nEnter diameter: "))
(if (= d nil)
(setq cont nil)
(progn
(setq p1 (cdr (assoc 10 L)) p2 (cdr (assoc 11 L)) )
(setq s1 (polar p1 (+ (angle p1 p2) (/ pi 2.0)) 1.0))
(setq s2 (polar p1 (- (angle p1 p2) (/ pi 2.0)) 1.0))
(setq bm (getvar "blipmode") ce (getvar "cmdecho")
os (getvar "osmode"))
(setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "osmode" 0)
(command "Offset" (/ d 2.0) e s1 "") (FIXUP)
(command "Offset" (/ d 2.0) e s2 "") (FIXUP)
(setvar "blipmode" bm) (setvar "cmdecho" ce) (setvar "osmode" os)
) ; finish progn
) ; finish if = d
) ; finish while
) ; finish progn
(prompt "\nERROR: Selected item MUST be a LINE.")
) ; finish if = "LINE"
) ; finish if /= e
(princ)
)
Solved! Go to Solution.