展开全部
entmake函数好像做不到创建面域,e5a48de588b662616964757a686964616f31333431343662可以使用vlisp函数来做。代码如下:;封闭曲线变面域;例
(defun c:tes ()
(if (and (setq ent (entsel "\n请选择封闭的曲线"))
(setq ent (car ent))
(setq obj (vlax-ename->vla-object ent))
(vlax-curve-isClosed obj)
)
(progn
(setq obj (ZH_MY obj));得到面域图元
)
)
(princ)
)
;面域转换
(defun ZH_MY (obj / ms obj obj1 va)
(setq ms (vla-get-modelspace (vla-get-ActiveDocument (vlax-get-acad-object)))
va (vlax-make-safearray vlax-vbObject '(0 . 0))
)
(vlax-safearray-put-element va 0 obj)
(if (vl-catch-all-error-p (setq obj1 (vl-catch-all-apply 'vla-addregion (list ms va))))
(setq obj1 nil)
(vl-catch-all-apply 'vla-delete (list obj));删除原来的对象
)
obj1
)