106
1万
101
顶梁支柱
; 2 line dcl save as a library function a nd autoload; sample code (ah:getval2 "line 1" 4 3 "line2" 8 7)(defun AH:getval2 (title1 width1 limit1 title2 width2 limit2 / fo);(setq fname (strcat (getvar "SAVEFILEPATH") "\\getval2.dcl"))(setq fname (strcat (getenv "TEMP") "\\getval2.dcl"))(setq fo (open fname "w"))(write-line "ddgetval2 : dialog {" fo)(write-line " : column {" fo)(write-line ": edit_box {" fo)(write-line (strcat " key = " (chr 34) "key1" (chr 34) ";") fo)(write-line (strcat " label = " (chr 34) title1 (chr 34) ";" ) fo)(write-line (strcat " edit_width = " (rtos width1 2 0) ";" ) fo)(write-line (strcat " edit_limit = " (rtos limit1 2 0) ";" ) fo)(write-line " is_enabled = true ;" fo)(write-line " }" fo)(write-line "spacer_1 ;" fo)(write-line ": edit_box {" fo)(write-line (strcat " key = " (chr 34) "key2" (chr 34) ";") fo)(write-line (strcat " label = " (chr 34) title2 (chr 34) ";" ) fo)(write-line (strcat " edit_width = " (rtos width2 2 0) ";" ) fo)(write-line (strcat " edit_limit = " (rtos limit2 2 0) ";" ) fo)(write-line " is_enabled = true ;" fo)(write-line " }" fo)(write-line " }" fo)(write-line "spacer_1 ;" fo)(write-line "ok_only;}" fo)(close fo); code part(setq dcl_id (load_dialog fname))(if (not (new_dialog "ddgetval2" dcl_id))(exit))(mode_tile "key1" 3)(action_tile "key1" "(setq val1 $value)")(mode_tile "key2" 3)(action_tile "key2" "(setq val2 $value)")(start_dialog)(done_dialog)(unload_dialog dcl_id); returns the value of val1 and val2 as strings)
(ah:getval2 "MOVE IN X OR Y enter value X or Y" 4 3 "ENTER OFFSET VALUE -VE OR +VE <L-R U-D>" 8 7)(IF (= VAL1 (STRCASE "X"))(c:ptx)(c:pty))(defun c:PTX ( / Pt)(setq oldsnap (getvar "osmode'))(setq pt (getpoint "pick point"))(setvar "osmode" 0)(command "point" pt)(Command "Move" "L" "" (list 0 0 0) (list (rtos val2) 0 0))(setvar "osmode" oldsnap))(defun c:PTY ( / Pt )(setq oldsnap (getvar "osmode'))(setq pt (getpoint "pick point"))(setvar "osmode" 0)(command "point" pt)(Command "Move" "L" "" (list 0 0 0) (list 0 (rtos val2) 0))(setvar "osmode" oldsnap))
使用道具 举报
7
34
27
初来乍到
;(vla-regen (vla-get-activedocument (vlax-get-acad-object)) ;acallviewports ; );(vl-load-com)
63
6297
6283
后起之秀
(/ (read (get_tile "mval")) 12.)
; have a look at this try it with ortho on and dragging mouse typing distance its just so quick 2 lines of code compare to above(command "_pline") (while (= (getvar "cmdactive") 1 ) (command pause))
本版积分规则 发表回复 回帖后跳转到最后一页
微信公众平台
扫描访问手机版
点击图片下载手机App
|关于我们|小黑屋|乐筑天下 繁体中文
GMT+8, 2025-3-12 13:34 , Processed in 0.880688 second(s), 60 queries .
© 2020-2025 乐筑天下
在线时间:10:00-17:00
暂无
扫一扫,关注我们
帮助中心
关于我们
下载APP客户端