这是个坏消息!
Brian,我在这个ooollddd笔记本电脑中没有AC2015,但我记得AC2015上“bpoly”函数生成的错误上的一些线程,我不知道它是否在某些SP中得到了纠正。。。
“bpoly”中的错误是一个无休止的循环,如果您可以尝试代码,请在新的dwg中尝试代码,并且只有一个打开的dwg,以防您不得不“终止进程”。
告诉我它是否有效。
如果没有,我们可能必须将“bpoly”更改为命令,并测试有效的新“entlast”。。。
在AC2015年,它也应该像预期的那样工作
- (vl-load-com)
- (defun c:demo ( / adoc bp cen ent-l lays msp pa pl plo reg sfa txt)
- (setq adoc (vla-get-activedocument (vlax-get-acad-object))
- msp (vla-get-modelspace adoc)
- lays (vla-get-layers adoc)
- )
- (vla-add lays "Router - Green - V groove")
- (setq ent-l (entlast))
- (while (and (setq pa (getpoint "\n Select Panel Area: "))
- (setq pl (getstring (strcat "\nEnter a Panel Label <" (cond (*pl) ("123")) ">: "))
- *pl (cond ((/= pl "") (strcase pl)) (*pl) ("123"))
- )
- (vl-cmdf "-boundary" "Advanced" "Island" "No" "Nearest" "" pa "")
- (setq bp (entlast))
- (not (eq ent-l bp))
- )
- (setq plo (vlax-ename->vla-object bp)
- sfa (vlax-make-safearray vlax-vbObject '(0 . 0))
- )
- (vla-put-layer plo "Router - Green - V groove")
- (vlax-safearray-put-element sfa 0 plo)
- (setq reg (car (vlax-safearray->list (vlax-variant-value (vla-addregion msp sfa))))
- cen (vlax-get reg 'centroid)
- )
- (vla-delete reg)
- (setq txt (vla-AddText msp *pl (vlax-3D-point (trans cen 1 0)) (getvar 'TEXTSIZE)))
- (vla-put-alignment txt 10)
- (vla-put-textalignmentpoint txt (vlax-3D-point (trans cen 1 0)))
- (vla-put-rotation txt (angle (list 0 0)(getvar 'UCSXDIR)))
- (setq ent-l bp)
- )
- (princ)
- )
希望有帮助
亨里克 |