插入块的代码,2个问题
1、怎么默认比例为1,要不没次要打上去 2路径前面加*号是插入后炸开,但是加了*号后插入后不显示动态效果(DEFUN C:dtys( )
(SETVAR "CMDECHO" 0)
(SETVAR "OSMODE" 0);关闭捕捉
(COMMAND "_INSERT" "*D:\\钢管图块.dwg" (getpoint "\n图块插入点:"))
(princ);静默退出
1,command 后面加上去
2,不要加*号,插完再炸 start4444 发表于 2024-11-12 22:38
1,command 后面加上去
2,不要加*号,插完再炸
大哥帮我填上去,我填的不行 本帖最后由 kozmosovia 于 2024-11-13 10:21 编辑
(DEFUN C:dtys ()
(SETVAR "CMDECHO" 0)
(SETVAR "OSMODE" 0) ;关闭捕捉
(COMMAND "_INSERT"
"D:\\钢管图块.dwg"
(getpoint "\n图块插入点:")
)
(while (> (getvar "CMDACTIVE") 0) (command ""))
(command "_.explode" (entlast))
(princ) ;静默退出
)
kozmosovia 发表于 2024-11-13 10:19
朋友,这个现在不会旋转了 本帖最后由 kozmosovia 于 2024-11-13 15:02 编辑
第六行(getpoint "\n图块插入点:")改成 (getpoint "\n图块插入点:") "1" pause
或者先插入再旋转(DEFUN C:dtys ()
(SETVAR "CMDECHO" 0)
(SETVAR "OSMODE" 0) ;关闭捕捉
(COMMAND "_INSERT"
"D:\\钢管图块.dwg"
(getpoint "\n图块插入点:")
)
(while (> (getvar "CMDACTIVE") 0) (command ""))
(command "_.Rotate" (entlast) "" (cdr (assoc 10 (entget (entlast)))) pause)
(command "_.explode" (entlast))
(princ) ;静默退出
)
kozmosovia 发表于 2024-11-13 14:28
第六行(getpoint "\n图块插入点:")改成 (getpoint "\n图块插入点:") "1" pause
或者先插入再旋转
大哥再帮我看看这个,插入块后,不会旋转
(defun c:tk1()
(setq cmdmode (getvar "cmdecho"))
(setvar "cmdecho" 0)
(if (= dir_lisp nil)
(command "insert" "D:\\工具\\block\\lispblock" '(quit)))
(setq dir_lisp "D:\\工具\\")
(tk_dcl_auto)
(prin1)
)
(defun tk_dcl_auto( / idd tk_id)
(setq idd (load_dialog (strcat dir_lisp "dcl\\tk")))
(if (< idd 0) (exit))
(if (not (new_dialog "tk_radio" idd)) (exit))
(setq tk_sldkey_list '("22新" "26新" "30新" "22拆""26拆""30拆""原有拉线"))
(setq tk_sld_list '("22新" "26新" "30新" "22拆""26拆""30拆""原有拉线"))
(mapcar 'tk_show_sld tk_sldkey_list tk_sld_list)
(setq xh "22新")
(mode_tile "22新" 2)
(action_tile "22新" "(setq xh \"22新\")");"action_tile"
(action_tile "26新" "(setq xh \"26新\")");
(action_tile "30新" "(setq xh \"30新\")")
(action_tile "22拆" "(setq xh \"22拆\")");"
(action_tile "26拆" "(setq xh \"26拆\")")
(action_tile "30拆" "(setq xh \"30拆\")")
(action_tile "原有拉线" "(setq xh \"原有拉线\")")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog -1)")
(setq tk_id (start_dialog))
(unload_dialog tk_id)
;;; (if (< tk_id 0)
;;; (unload_dialog))
(if (> tk_id 0) (command "insert" xh "x" 1 "y" 1 "r" 0 (getpoint "请选择插入点")))
;;; (setq pp (cdr(assoc 10 (entget(entlast)))))
(princ)
)
(prompt "============<命令TK1>=============")
;对sld文件做相应的设置动作===============================
(defun tk_show_sld(tk_key tk_sld)
(setq tk_x (dimx_tile tk_key))
(setq tk_y (dimy_tile tk_key))
(start_image tk_key)
(fill_image 0 0 tk_x tk_y -2)
;;; (slide_image 0 0 tk_x tk_y (strcat dir_lisp "sld\\" tk_sld))
(slide_image 0 0 80 60 (strcat dir_lisp "sld\\" tk_sld))
(end_image)
) 不错不错学习
页:
[1]