Electrical Wiring Using LISP in AutoCAD- Time Saving Lisp in AutoCAD.
ฝัง
- เผยแพร่เมื่อ 31 ธ.ค. 2024
- ;; CAB 05.13.09
;; Draw Electric Wire
(defun c:ew (/ ew_layer p1 p2 msg height ang)
(setvar 'filletrad 150)
(setq ew_layer (getvar "CLAYER")) ; set current layer
(setq height (/ 200 (getvar "CANNOSCALEVALUE"))) ; set chamfer height
(setq ang 45) ; set chamfer angle
(defun draw-ew (p4 p1 lay / p2 p3)
(setq p2 (polar p1 (- (angle p1 p4) (/ (* ang pi) 180)) height)
p3 (polar p4 (+ (angle p4 p1) (/ (* ang pi) 180)) height)
)
(entmakex
(list
'(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
(cons 8 lay)
(cons 90 4)
'(70 . 0) ; 1 for closed 0 overwise
(cons 10 (trans p1 1 0))
'(40 . 0.0)
'(41 . 0.0)
'(42 . 0.0)
(cons 10 (trans p2 1 0))
'(40 . 0.0)
'(41 . 0.0)
'(42 . 0.0)
(cons 10 (trans p3 1 0))
'(40 . 0.0)
'(41 . 0.0)
'(42 . 0.0)
(cons 10 (trans p4 1 0))
'(40 . 0.0)
'(41 . 0.0)
'(42 . 0.0)
'(210 0.0 0.0 1.0)
)
)
)
(and
(setq p1 (getpoint "
Pick start point (Draw clockwise"))
(setq msg "
Pick next point clockwise.")
(while (setq p2 (getpoint p1 msg))
(command "_.fillet" "_P" (draw-ew p1 p2 ew_layer))
(setq p1 p2)
)
)
(princ)
)
Copy and paste in the AutoCAD upto above part and use command EW.
Join this channel to get access to perks:
/ @autocadrevitbyju