这
- (defun c:test ( / doc spc ss n r ) (vl-load-com)
- ;; Example by Lee Mac 2010 www.lee-mac.com
- (setq spc
- (vlax-get-property (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
- (if (= 1 (getvar 'CVPORT)) 'PaperSpace 'ModelSpace)
- )
- )
- (if (ssget "_X" '((0 . "LWPOLYLINE") (8 . "XXX*")))
- (progn
- (vlax-for o (setq ss (vla-get-ActiveSelectionSet doc))
- (vla-move (setq n (vla-copy o))
- (vlax-3D-point '(0. 0. 0.)) (vlax-3D-point '(15000. 0. 0.))
- )
- (vla-put-closed n :vlax-true)
- (vla-AddExtrudedSolid spc (car (setq r (vlax-invoke spc 'AddRegion (list n)))) 500. 0.)
- (vla-delete n)
- (mapcar 'vla-delete r)
- )
- (vla-delete ss)
- )
- (princ "\n** No LWPolylines Found **")
- )
- (princ)
- )
|