- (defun C:trans2d ()
- (VL-LOAD-COM)
-
- (setq AcadObject (vlax-get-acad-object))
- (setq AcadDocument (vla-get-ActiveDocument Acadobject))
- (setq mSpace (vla-get-ModelSpace Acaddocument))
-
- (setq ename (car (entsel "选择要转换的三维多段线:")))
- (setq ent_data (entget ename))
- (setq str_0 (cdr (assoc 0 ent_data)))
- (while (/= str_0 "POLYLINE")
- (setq ename (car (entsel "选择的实体非三维多段线,请重新选择!:")))
- (setq ent_data (entget ename))
- (setq str_0 (cdr (assoc 0 ent_data)))
- )
- (setq obj (vlax-ename->vla-object ename))
- (setq pts (vlax-variant-value (vla-get-coordinates obj)))
- (vla-AddPolyline mSpace pts)
- (princ)
-
- )
|