明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: masterlong

请教一个很特别的问题

  [复制链接]
 楼主| 发表于 2005-7-31 22:39:00 | 显示全部楼层

发个图上来大家看看

1M多

目前我唯一能想到的解决办法

就是转为dxf格式后

删除不需要的内容再转为dwg

可是我能这样做

那些只会CAD操作的人不会啊

 

 楼主| 发表于 2005-7-31 22:40:00 | 显示全部楼层
论坛上传功能不能用吗
 楼主| 发表于 2005-7-31 22:44:00 | 显示全部楼层
  当您的朋友需要提取此文件时只需:
     匿名提取文件连接 http://pickup.mofile.com/4784767482425701
     或登录Mofile,使用提取码 4784767482425701 提取文件

 

还是发我的mofile里吧

三天后过期

想看的人要下抓紧

 楼主| 发表于 2005-8-2 01:29:00 | 显示全部楼层

编了个简单的程序,将就的用

(defun ts_err()
 (setvar "cmdecho" 0)
 (setvar "filedia" 0)
 (setq olderr *error* )

   (defun *error*(msg)
    (princ "\n程序中断,未清除任何“命名图层过滤器”")
    (close *dxf文件_old)
 (close *dxf文件_new)
 (setvar "filedia" 1)
 (setvar "cmdecho" 1)
 (setq *error* olderr)
   (princ)
   )

(princ)
)

(defun c:pulf()
 (princ "\n本程序将完全清理文件内的“命名图层过滤器”。")
 (princ "\n若文件内并无“命名图层过滤器”,运行本程序可能导致死循环.")
 (princ "\n程序长时间无反应,请按“ESC键”退出,并检查文件内是否含有“命名图层过滤器”.")
 (princ "\n若文件内确实含有“命名图层过滤器”,请再次运行本程序,并耐心等待")
 
 (ts_err)
 
 (setq *dwgname (getvar "DWGNAME"))
 (setq *dwgname (strcat (substr *dwgname 1 (- (strlen *dwgname) 4)) ".dwg" ))
 (setq *dxfname (strcat (substr *dwgname 1 (- (strlen *dwgname) 4)) ".dxf" ))
 (setq *scrname (strcat (substr *dwgname 1 (- (strlen *dwgname) 4)) ".scr" ))
 (setq *path (getvar "DWGPREFIX"))
 (setq *alldxf (strcat *path *dxfname))
 (setq *alldwg (strcat *path *dwgname))
 (setq *allscr (strcat *path *scrname))

 (princ "\n正在清理图层过滤器,请稍后....")
 (princ)


 (setq *dxf文件_old (open *alldxf "w"))
 (close *dxf文件_old)
 (command "saveas" "DXF" "V" "2000" "16" *alldxf "y")
 (command "saveas" "2000" *alldwg "y")
 
 (清理层过滤表)
 (关再开)
(princ)
)


(defun 清理层过滤表()
 (setq *dxf文件_old (open *alldxf "r"))
 (setq *dxf文件_new (open (strcat (substr *alldxf 1 (- (strlen *alldxf) 4)) "new.dxf" ) "w") )
 
 (setq loop_1 T)
 (while loop_1
  (setq a (read-line *dxf文件_old))
  (cond
   ((null a)(setq loop_1 nil) )
   ((= a "AcDbDictionary")
    (write-line a *dxf文件_new) 
    (progn
     (setq loop_2 T) 
     (while loop_2
      (setq a1 (read-line *dxf文件_old))
      (setq a2 (read-line *dxf文件_old))
      (setq a3 (read-line *dxf文件_old))
      (setq a4 (read-line *dxf文件_old))
      (write-line a1 *dxf文件_new)
      (write-line a2 *dxf文件_new)
      (write-line a3 *dxf文件_new)
      (write-line a4 *dxf文件_new)
      (if  (and
        (= a1 "280")
        (= a2 "     1")
        (= a3 "281")
        (= a4 "     1")
           )
       (progn
        (setq loop_3 T) 
        (while loop_3
         (setq a1 (read-line *dxf文件_old))
         (setq a2 (read-line *dxf文件_old))
         (if (and (= a1 "  0")(= a2 "DICTIONARY"))
          (progn
           (write-line a1 *dxf文件_new)
           (write-line a2 *dxf文件_new)
           (setq loop_3 nil)
           (setq loop_2 nil)
          )
         )
        )
       )
       (setq loop_2 nil)
      )
     )
    )
   )
   ((/= a "AcDbDictionary") (write-line a *dxf文件_new) )
  )
 )
 (close *dxf文件_old)
 (close *dxf文件_new)
 (princ "ok")
 (princ "\n重新打开文件")(princ)
(princ)
)

(defun 关再开()
 (setq *scrfile (open *allscr "w"))
 
 (write-line "close" *scrfile)
 (write-line "open" *scrfile)
 (write-line (strcat (substr *alldxf 1 (- (strlen *alldxf) 4)) "new.dxf" ) *scrfile)
 (write-line "saveas" *scrfile)
 (write-line "2000" *scrfile)
 (write-line *alldwg *scrfile)
 (write-line "Y" *scrfile)
 (write-line "filedia" *scrfile)
 (write-line "1" *scrfile)
 (write-line "cmdecho" *scrfile)
 (write-line "1" *scrfile)
 
 (close *scrfile)
 (command "script" *allscr)
)

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-2-22 02:05 , Processed in 0.172209 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表