 - lmfh:dialog{
- label="立面符号插入工具——by 凯 凯";
- :row{
- :boxed_column{
- :edit_box{
- label="索引页码:";
- key="syym_sc";
- edit_width=15;
- edit_limit=15;
- fixed_width=true;
- }
- :edit_box{
- label="索引图号:";
- key="syh_sc";
- edit_width=15;
- edit_limit=15;
- fixed_width=true;
- }
- :edit_box{
- label="当前比例:";
- key="bl_sc";
- edit_width=15;
- edit_limit=15;
- fixed_width=true;
- }
- }
- :boxed_column{
- :image{
- key="lmimage";
- width=15;
- height=7;
- fixed_width=true;
- fixed_height=true;
- color=-2;
- allow_accept=true;
- }
- }
- }
- ok_cancel;
- }
 - ;;;立面符号插入命令,作者:凯凯
- (defun c:s1q (/ lst ptt1 pt1 n1 n2 n8 n2 keyk keyp fh_layer)
- (command "undo" "be")
- (command "ATTDIA" 0)
- (dcl_lmfh)
- (command "undo" "e")
- (princ)
- )
- (defun dcl_lmfh ()
- (if (> (setq dcl_id (load_dialog "lmfh")) 0) (progn
- (if (new_dialog "lmfh" dcl_id) (progn
- (setq key "lmimage")
- (setq px (dimx_tile key))
- (setq py (dimy_tile key))
- (start_image key)
- (fill_image 0 0 px py -2)
- (slide_image 0 0 px py "lmfh")
- (end_image)
- (setq zs_err 1)
- (set_tile "bl_sc" (rtos (getvar "DIMSCALE")))
- (if (and (= (type keyk) 'STR) (> (strlen keyk) 0))
- (set_tile "syym_sc" keyk)
- (set_tile "syym_sc" "索引页码") ;;;设置索引页码1
- )
- (if (and (= (type keyp) 'STR) (> (strlen keyp) 0))
- (set_tile "syh_sc" keyp)
- (set_tile "syh_sc" "索引号") ;;;设置索引号1
- )
- (action_tile "bl_sc" "(testbl)")
- (action_tile "cancel" "(done_dialog 0)")
- (action_tile "accept" "(ok_lmfh) (done_dialog 1)")
- (setq dd (start_dialog))
- )
- (princ "\n无法显示对话框!")
- )
- (unload_dialog dcl_id)
- )
- (princ "\n无法加载对话框!")
- )
- (if (= dd 1) (progn
- (while (= (setq pt1 (getpoint "\n指定立面符号插入点:")) nil)
- (princ "\n*错误*,请指定立面符号插入点或按ESC键结束命令:")
- )
- (if (not (tblsearch "block" "立面图号")) ;;判断是否存在"立面图号"图块,无则创建。
- (command "INSERT" "klimianp" "0.0" 1 1 0)
- )
- (command "layer" "s" fh_layer "")
- (if (= err 1)
- (princ "立面图号未插入")
- (command "INSERT" "立面图号" pt1 n1 n1 "" keyk keyp)
- )
- ))
- )
- (defun testbl ()
- (setq n1 (get_tile "bl_sc"))
- (if (= (rtos n1 2) 0) (set_tile "bl_sc" (rtos (getvar "DIMSCALE") 2)))
- )
- (defun ok_lmfh ()
- (setq n1 (get_tile "bl_sc"));;;当前标注比例
- (if (= n1 "") (setq n1 n2))
- (setq keyk (get_tile "syym_sc")) ;;;;;请输入索引页码,如D-01,D-02,D-03.
- (if (= keyk "") (setq keyk "索引页码"))
- (setq keyp (get_tile "syh_sc")) ;;;;; 请输入索引号,如1,2,3... A,B,C...<1>:
- (if (= keyp "") (setq keyp "索引号"))
- )
|