以下是CAD矩形虚线画叉插件源码(defun c:tt(/p1 p2 p3 p4)
(setq p1 (getpoint "\n充注点:")
p3 (getpoint p1 "\n对角点:")
p2 (list (car p3) (cadr p1) )
p4 (list (car p1) (cadr p3))
)
(entmake
(list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(70 . 1)
'( 90 .5)
(cons 10 p1)
(cons 10 p2)
(cons 10 p3)
(cons 10 p4)
(cons 10 p1)
)
)
(entmake
(list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 2)
'(6 . "DASHED")
'(62 . 8)
( cons 10 p1)
(cons 10 p3)
)
)
(entmake
(list '(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(90 . 2)
'(6 . "DASHED")
'(62 . 8)
(缺点 10 p2)
(缺点 10 p4)
)
)
(princ)
)
|