明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2726|回复: 5

block insert both with button & preview of sld

[复制链接]
发表于 2012-3-24 21:27 | 显示全部楼层 |阅读模式
Dear All,
very urgent please help me
block insert both with button & preview of sld



该贴已经同步到 sachindkini的微博

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2012-3-26 16:14 | 显示全部楼层
ANY PEOPLE HELP ME
发表于 2012-3-26 16:35 | 显示全部楼层
本帖最后由 xshrimp 于 2012-3-26 16:39 编辑

参考下面这个http://web2.airmail.net/terrycad/AutoLISP-Code.htm

Block Library has been revised to be compatible with AutoCAD 2008. The dialogs with slide images have been redesigned and enlarged to accommodate space for longer block names. Block Library is an AutoLISP utility for managing blocks by storing blocks and block slides images in Block Libraries. The block slide images can be quickly viewed in the Block Libraries before inserting them into a drawing. Blk_Lib requires functions inside of GetIcon.lsp.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2012-3-26 19:55 | 显示全部楼层
AutoCad design center is better and standard.
 楼主| 发表于 2012-3-27 02:52 | 显示全部楼层
yarp 发表于 2012-3-26 19:55
AutoCad design center is better and standard.

dear sir
thx for reply
better option is design center is true,
but im study the autolisp code because i want sample code of this image
 楼主| 发表于 2012-3-27 03:15 | 显示全部楼层
本帖最后由 sachindkini 于 2012-3-27 03:16 编辑

dear sir,

see code but only add please sld file for preview

  1. (defun c:vblk ( / block id name )    (cond        (   (<= (setq id (load_dialog "vblk.dcl")) 0)            (princ "\nDCL File not found.")        )        (   (not (new_dialog "valveblk" id))            (princ "\nDialog could not be loaded.")        )        (   t            (foreach tile '("GATEV" "GLOBE" "BALL" "BUTTERFLY" "CHECK" "PLUG" "WAFER" "NEEDLE" "GLOBE-CV")                (action_tile tile "(setq name $key) (done_dialog)")            )            (start_dialog)            (if name                (if                    (or                        (tblsearch "BLOCK" (setq block name))                        (setq block (findfile (strcat name ".dwg")))                    )                    (command "_.-insert" block "_S" 1.0 "_R" 0.0 pause)                    (princ (strcat "\nBlock: " name ".dwg could not be found."))                )                (princ "\n*Cancel*")            )        )    )    (if (< 0 id) (unload_dialog id))    (princ))


  1. bt : button { width = 15; height = 2; fixed_width = true; fixed_height = true; }valveblk : dialog { label = "Select block to insert"; spacer;    : boxed_column { label = "Valves";        : row {            : column {                : bt { key = "GATEV"; label  ="GATE" ; }                : bt { key = "GLOBE"; label  ="GLOBE"; }                : bt { key = "BALL" ; label = "BALL" ; }                : bt { key = "BUTTERFLY" ; label = "B/FLY"; }            }            : column {                : bt { key = "CHECK"; label = "CHECK"; }                : bt { key = "PLUG" ; label = "PLUG" ; }                : bt { key = "WAFER"; label = "WAFER"; }                : bt { key = "NEEDLE"; label = "NEEDLE"; }            }        }        spacer;    }    : boxed_column { label = "Control Valves";         : bt { key = "GLOBE-CV"; label = "GLOBE CV"; } spacer;    }    : bt { key = "accept"; label = "Cancel"; is_default = true; is_cancel = true; alignment = centered; }}

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

本版积分规则

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

GMT+8, 2024-4-20 04:51 , Processed in 0.191377 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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