三维多段线转二维多段线程序,在VLIDE调试成功,也能实现所要实现的功能,但用(load "trans2d")加载时出错!提示; 错误: SETQ 中变量名错误: (vla-AddPolyline MSPACE PTS)!我已经检查了很多遍了,没有什么错误呀!再说了,在VLIDE中调试成功,也实现了我要的功能呀!不知道哪里出了问题,请指点!谢谢 (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) ) |