明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1843|回复: 4

how to create sld file in silent mod

[复制链接]
发表于 2012-3-20 16:04 | 显示全部楼层 |阅读模式
本帖最后由 sachindkini 于 2012-3-20 16:05 编辑

dear all
how to create sld file in silent mode without open any drawing (it's possible)
because so many files


该贴已经同步到 sachindkini的微博
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2012-3-20 18:45 | 显示全部楼层
;;将CAD图形DWG文件批量转成幻灯片
(defun C:DWG2SLD (/ ACADOBJ DOC DWG_DIR DWG_LST NAME SDI)
  ;;By carrot1983
  (defun CJW-FILE-GET (MSG / WINSHELL SHFOLDER PATH CATCHIT)
    (setq WINSHELL (vlax-create-object "Shell.Application"))
    (setq
      SHFOLDER (vlax-invoke-method WINSHELL 'BROWSEFORFOLDER 0 MSG 1)
    )
    (setq
      CATCHIT (vl-catch-all-apply
                '(lambda ()
                   (setq SHFOLDER (vlax-get-property SHFOLDER 'SELF))
                   (setq PATH (vlax-get-property SHFOLDER 'PATH))
                 )
              )
    )
    (if        (vl-catch-all-error-p CATCHIT)
      NIL
      PATH
    )
  )
  (princ
    "\n将CAD图形DWG文件批量转成幻灯片(DWGTOSLD) By carrot1983 2009-05-10"
  )
  (setvar "CMDECHO" 0)
  (alert "\n注意: 备份原图!!!")
  (if (and (setq DWG_DIR (CJW-FILE-GET "选择DWG文件夹"))
           (setq DWG_LST (vl-directory-files DWG_DIR "*.DWG" 1))
      )
    (progn
      (foreach DWG DWG_LST
        (if (setq SS (ssget "x"))
          (command "._ERASE" SS "")
        )
        (setq DWG (strcat DWG_DIR "\\" DWG))
        (setq SLD (strcat DWG_DIR "\\" (vl-filename-base DWG) ".sld"))
        (command ".-INSERT" DWG "_NON" '(0. 0. 0.) "1" "1" "0")
        (command "._ZOOM" "_E")
        (command "._MSLIDE" SLD)
        (print SLD)
      )
      (alert "程序完毕 <DWG2SLD>")
      (command "._BROWSER" "http://carrot1983.blog.sohu.com/")
    )
  )
  (princ)
)

点评

学习了,谢谢  发表于 2012-3-21 20:06
 楼主| 发表于 2012-3-21 17:48 | 显示全部楼层
langjs 发表于 2012-3-20 18:45
;;将CAD图形DWG文件批量转成幻灯片
(defun C:DWG2SLD (/ ACADOBJ DOC DWG_DIR DWG_LST NAME SDI)
  ;;By  ...

dear sir,

thx very nice program
but very slow
how can increase the speed
发表于 2012-3-21 19:25 | 显示全部楼层
Nothing better to do  
 楼主| 发表于 2012-3-21 23:12 | 显示全部楼层
langjs 发表于 2012-3-21 19:25
Nothing better to do

dear sir,

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

本版积分规则

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

GMT+8, 2024-3-29 18:09 , Processed in 0.308557 second(s), 34 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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