发布于:2003-04-30 12:08:30
来自:建筑设计/CAD下载及教程
[复制转发]
(defun c:d3 (/ ent_lns ent_ln ent_jings ent_jing pt bj tmp_cir pt1 c0 c1)
(princ "******** 清除检查井内管线 *******")
(command "_.undo" "_begin")
(setvar "osmode" 0)
(princ "\n选择检查井:")
(setq ent_jings (ssget ((0 . "insert") (2 . "$WX_JCJ"))))
(princ "\n选择管线:")
(setq ent_lns (ssget ((0 . "line") (8 . "wp_*"))))
(setq c1 0)
(repeat (sslength ent_jings)
(setq ent_jing (ssname ent_jings c1))
(setq pt (sws_getval ent_jing 10))
(setq bj (sws_getval ent_jing 41))
(setq bj (* 0.5 bj))
(command "circle" pt bj)
(setq tmp_cir (entlast))
(setq c0 0)
(repeat (sslength ent_lns)
(setq ent_ln (ssname ent_lns c0))
(setq pt1 (car (xdrx_entity_intersect ent_ln tmp_cir)))
(if (/= pt1 nil) (command "break" ent_ln pt1 pt))
(setq c0 (1+ c0))
);end repeat
(command "erase" tmp_cir "")
(setq c1 (1+ c1))
);end repeat
(command "_.undo" "_end")
(princ)
)
(defun sws_GetVal (wz_ent wz_id / wz_elst wz_val)
(setq wz_elst (entget wz_ent))
(setq wz_Val (cdr (assoc wz_id wz_elst)))
(princ)
wz_Val
)
全部回复(8 )
只看楼主 我来说两句用第一个无法执行,
Command: d3
******** 清除检查井内管线 *******_.undo
Auto/Control/BEgin/End/Mark/Back/: _begin
Command: error: bad argument type
(SSNAME ENTS C0)
(SETQ ENT (SSNAME ENTS C0))
(WHILE FLAG (SETQ ENT (SSNAME ENTS C0)) (IF (= (SWS_GETVAL ENT 0) "LINE")
(PROGN (SETQ ENT_LNS (SSADD ENT)) (SETQ FLAG nil))) (SETQ C0 (1+ C0)))
(C:D3)
*Cancel*
用第二个执行过程出错:
Command: d5 ******** 清除检查井内管线(纯圆) *******_.undo
Auto/Control/BEgin/End/Mark/Back/: _begin
Command:
Select objects: Other corner: 14 found
7 were filtered out.
Select objects:
error: bad argument type
(ENTGET WZ_ENT)
(SETQ WZ_ELST (ENTGET WZ_ENT))
(SWS_GETVAL ENT 0)
(= (SWS_GETVAL ENT 0) "CIRCLE")
(IF (= (SWS_GETVAL ENT 0) "CIRCLE") (PROGN (SETQ ENT_JINGS (SSADD ENT)) (SETQ
FLAG nil)))
(WHILE FLAG (SETQ ENT (SSNAME ENTS C0)) (IF (= (SWS_GETVAL ENT 0) "CIRCLE")
(PROGN (SETQ ENT_JINGS (SSADD ENT)) (SETQ FLAG nil))) (SETQ C0 (1+ C0)))
(C:D5)
*Cancel*
回复 举报
不过告诉大家一下,正式版本可是不存在该问题的呀!
回复 举报