- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I dont even know to describe this. I am trying to write a lisp for auto dim, in which i will pre define a variable for dimesion line location but the defined variable is not always be consider when the lisp is excuted
(defun c:D2 ()
(while (not (equal (setq ent (entsel)) nil))
(progn
(setq dxf (entget (car ent)))
(setq start (cdr (assoc 10 dxf)))
(setq end (cdr (assoc 11 dxf)))
(command "dimaligned" start end)
(princ)
)
)
)
--------------------------------------------
(defun c:d11 ()
(setq d11 (getreal "nhap khoang cach"))
)
--------------------------------------------
(defun c:d1 ()
(setq ss (ssget)
len (sslength ss)
i 0
)
(if (not (boundp 'd11))
(setq D11 40)
)
(repeat len
(progn
(setq ent (ssname ss i)
entd (entget ent)
i (+ 1 i)
)
(if (eq (cdr (assoc 0 entd)) ' "LINE")
(progn
(setq start (cdr (assoc 10 entd))
end (cdr (assoc 11 entd))
)
(command "dimaligned"
start
end
(trans (polar start (+ (angle start end) (/ pi 2)) d11) 0 1)
""
))
)
(command "mirror" ent "" (cdr (assoc 13 entd)) (cdr (assoc 14 entd)) "Y")
)
)
)
Solved! Go to Solution.