明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1688|回复: 1

[分享]将图层信息写到网页上

[复制链接]
发表于 2005-1-28 15:33:00 | 显示全部楼层 |阅读模式
(defun C:DUMPLAYERS
( / acad doc dwg layers name col ltp lwt pst onoff frz dat
path olist outfile output)
(vl-load-com)
(setq acad (vlax-get-acad-object)
doc (vla-get-activedocument acad)
dwg (vla-get-name doc)
path (vla-get-path doc)
layers (vla-get-layers doc)
)
(vlax-for each layers
(setq name (vla-get-name each)
col (itoa (vla-get-color each))
ltp (vla-get-linetype each)
lwt (itoa (vla-get-lineweight each))
pst (vla-get-plotstylename each)
onoff (if (= :vlax-true (vla-get-layeron each))
"ON" "OFF"
)
frz (if (= :vlax-true (vla-get-freeze each))
"FROZEN" "THAWED"
)
dat (list name col ltp lwt pst onoff frz)
olist (cons dat olist)
)
); vlax-for (vlax-release-object layers)
(vlax-release-object doc)
(vlax-release-object acad)
(cond
( olist
(setq outfile (strcat (vl-filename-base dwg) ".htm"))
(setq outfile (strcat path outfile))
(cond
( (setq output (open outfile "w"))
(write-line "<html>" output)
(write-line "<head><title>" output)
(write-line (strcat "Layer Dump: " dwg) output)
(write-line "</title></head><body>" output)
(write-line (strcat "<b>Drawing: " dwg "</b><br>") output)
(write-line "<table border=1>" output)
(foreach layset olist
(write-line "<tr>" output)
(foreach prop layset
(write-line (strcat "<td>" prop "</td>") output)
)
(write-line "</tr>" output)
); foreach layer set
(write-line "</table></body></html>" output)
(close output)
(setq output nil)
(princ "\nReport finished! Opening in browser...")
(vl-cmdf "_.browser" outfile)
)
( T (princ "\nUnable to open output file.") )
)
)
( T (princ "\nUnable to get layer table information.") )
)
)
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2005-1-28 21:07:00 | 显示全部楼层
David Stein        写过一个差不多的程序, 后来AfraLisp引用过.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 18:48 , Processed in 0.188060 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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