马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;;Written by WKAI @ XDCAD.NET________________
- ;;;___________________________________________
- (DEFUN c:region_to_pl (/ region_ent)
- (PRINC "\n选择需要转换为PL的REGION:")
- (SETVAR "cmdecho" 0)
- (SETQ region_ent (SSGET '((0 . "REGION"))))
- (IF region_ent
- (PROGN
- (COMMAND "._explode" region_ent)
- (COMMAND)
- (l_to_pl (SSGET "p"))
- )
- )
- )
- (DEFUN l_to_pl (ssa / ss1 lines ent n)
- (COMMAND "._undo" "be")
- (SETQ ss1 (SSADD))
- (REPEAT (SETQ n (SSLENGTH ssa))
- (SETQ ent (SSNAME ssa (SETQ n (1- n))))
- (IF (AND (ENTGET ent)
- (MEMBER (CDR (ASSOC 0 (ENTGET ent)))
- '("LINE" "ARC" "POLYLINE" "LWPOLYLINE")
- )
- )
- (SETQ ss1 (SSADD ent ss1))
- )
- )
- (SETQ lines ss1)
- (l_to_pl:main)
- (COMMAND "._undo" "e")
- )
- (DEFUN l_to_pl:main (/ ent ss1 n)
- (SETQ ent (SSNAME lines 0))
- (IF (MEMBER (CDR (ASSOC 0 (ENTGET ent)))
- '("POLYLINE" "LWPOLYLINE")
- )
- (IF (/= 1 (LOGAND (CDR (ASSOC 70 (ENTGET ent))) 1))
- (COMMAND "._pedit" ent "j" lines "" "")
- )
- (COMMAND "._pedit" ent "y" "j" lines "" "")
- )
- (SETQ lines (SSDEL ent lines))
- (SETQ ss1 (SSADD))
- (REPEAT (SETQ n (SSLENGTH lines))
- (SETQ ent (SSNAME lines (SETQ n (1- n))))
- (IF (ENTGET ent)
- (SETQ ss1 (SSADD ent ss1))
- )
- )
- (SETQ lines ss1)
- (WHILE (> (SSLENGTH lines) 0) (l_to_pl:main))
- )
|