尝试解决含有XCLIP实体的裂解问题
- ;炸开(含有Xclip块)的实体集---(一级)----
- ;MODIFY 三领设计;QQ:15290049
- (defun exp-xclip-blk (ss / file_path wmffile p1 p2 nam p0 e_lst lst d1 d2)
- (defun slhas (TYPE_1 NAME)
- (if (not
- (vl-catch-all-error-p
- (vl-catch-all-apply 'vla-item (list ((eval (read (strcat "vla-get-" TYPE_1))) *AcDocument*) NAME))
- )
- )
- t
- )
- )
- ;;-------------------
- (princ (slmsg "\n Xclip块裂解-->>" "\n Xclip遏吊秆-->>" "\ n Xclip block Explode-->"))
- (setq file_path (strcat sl-path0 "\\tmp"))
- (if (findfile file_path) (princ) (vxmakedirectory file_path))
- (setq wmffile (strcat file_path "\\WMF_" (slsjqs)))
- (while (findfile (strcat wmffile ".wmf"))
- (setq wmffile (strcat file_path "\\WMF_" (slsjqs)))
- )
- (setq lst (slget-box ss) p1 (car lst) p2 (cadr lst) d1 (distance p1 p2))
- (setq e_lst (sysvar '("WMFBKGND" "TILEMODE")))
- (setvar "WMFBKGND" 0);;清除底色
- (if (slhas "LAYOUTS" "Temporary layout")
- (princ)
- (command "layout" "n" "Temporary layout") ;创建并切换布局
- )
- (command "_.layout" "s" "Temporary layout")
- (setvar "tilemode" 0)
- (command "erase" (ssget "X" '((0 . "VIEWPORT"))) "") ;删除所有布局视口
- (command "mview" p1 p2)
- (vla-ZoomWindow *ACAD* (vlax-3d-point p1) (vlax-3d-point p2))
- (if (= (getvar "CVPORT") 1) (command "mspace")) ;激活视口;(command "pspace");切换到图纸空间
- (vla-ZoomWindow *ACAD* (vlax-3d-point p1) (vlax-3d-point p2))
- (if (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (command "wmfout" wmffile ss "")))))
- (progn
- (sl:-erase ss) ;删除
- (setvar "tilemode" 1) ;切换回模型空间
- (if (slhas "LAYOUTS" "Temporary layout")
- (command "_.layout" "D" "Temporary layout") ;删除临时布局
- )
- (command "_.wmfin" wmffile 1 1 1 0)
- (setq nam (entlast) lst (e9pt nam nil) p0 (nth 4 lst) d2 (distance (car lst) (nth 8 lst)))
- (command "SCALE" nam "" p0 (/ d1 d2) "_.MOVE" nam "" "non" p0 PAUSE)
- (vl-catch-all-apply 'exp-blk (list nam));炸块
- )
- )
- (mapcar 'eval e_lst)
- (princ)
- )
|