生成边界部分无法选中
朋友们,请教一下,我写了如下代码,功能是对填充进行重绘边界后进行选中生成的边界。但是目前有个问题,就是在特殊情况下,有部分边界无法选中,请高手帮忙看一下,是问题出在哪里,应该如何修改,感谢!
(setq ess (ssadd))
(setq ss (ssget '((0 . "HATCH")(97 . 0))))
(setq n (sslength ss))
(while (setq s (ssname ss (setq n (1- n))))
(command-s "hatchedit" s "b" "p" "y")
(setq ess (ssadd (entlast) ess))
)
(sssetfirst nil ess)
本帖最后由 guosheyang 于 2023-2-7 16:58 编辑
(建议用entlast) 搞个标记然后选择新产生的线 那两条线确实不能被选中 原因 不清楚 (defun c:tt ()
(setq lst (list))
(setq ess (ssadd))
(setq ss (ssget '((0 . "HATCH")(97 . 0))))
(setq n (sslength ss))
(while (setq s (ssname ss (setq n (1- n))))
(setq lst (append (list s) lst))
)
(foreach l lst
(setq s1 (entlast))
(command-s "hatchedit" l "b" "p" "y")
(while (setq s1 (entnext s1))(ssadd s1 ess))
)
(command-s "draworder" ess "" "f")
(sssetfirst nil ess)
)
朋友帮忙搞定了,感谢 !
发出来,分享给大家,希望对大家能有所帮助 。 (defun c:tt()
(setq bj(entlast))
(setq ss (ssget '((0 . "HATCH")(97 . 0))))
(setq n (sslength ss))
(while (setq s (ssname ss (setq n (1- n))))
(command-s "hatchedit" s "b" "p" "y")
)
(setq ess(ss-entnext bj))
(sssetfirst nil ess)
)
(defun ss-entnext (en / ss)
(if en
(progn
(setq ss (ssadd))
(while (setq en (entnext en))
(if (not (member (cdr (assoc 0 (entget en)))
'("ATTRIB"
"VERTEX"
"SEQEND"
)
)
)
(ssadd en ss)
)
)
(if (zerop (sslength ss))
(setq ss nil)
)
ss
)
(ssget "_x")
)
) 这样也可以的 (defun c:tt()
(setq ess (ssadd))
(setq ss (ssget '((0 . "HATCH")(97 . 0))))
(setq n (sslength ss))
(while (setq s (ssname ss (setq n (1- n))))
(setq s1(entlast))
(command-s "hatchedit" s "b" "p" "y")
(while (setq s1 (entnext s1))(ssadd s1 ess))
)
(sssetfirst nil ess) ) 这样好像也可以 感谢大佬的分享
页:
[1]