10
52
42
初露锋芒
使用道具 举报
63
6297
6283
后起之秀
106
1万
101
顶梁支柱
; this is an example it will need to be modified to suit your dwg; change the 410 to layout name;;-------------------=={ Parse Numbers }==--------------------;;;; ;;;; Parses a list of numerical values from a supplied string. ;;;;------------------------------------------------------------;;;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;;;------------------------------------------------------------;;;; Arguments: ;;;; s - String to process ;;;;------------------------------------------------------------;;;; Returns: List of numerical values found in string. ;;;;------------------------------------------------------------;;(defun LM:ParseNumbers ( s ) ( (lambda ( l ) (read (strcat "(" (vl-list->string (mapcar (function (lambda ( a b c ) (if (or (< 47 b 58) (and (= 45 b) (< 47 c 58) (not (< 47 a 58))) (and (= 46 b) (< 47 a 58) (< 47 c 58)) ) b 32 ) ) ) (cons nil l) l (append (cdr l) (list nil)) ) ) ")" ) ) ) (vl-string->list s) ));; Input Dialog box with variable title;; By Ah June 2012;; code (ah:getval title)(defun AH:Getval (title width limit / fo)(setq fname "C://acadtemp//getval.dcl")(setq fo (open fname "w"))(write-line "ddgetval : dialog {" fo)(write-line " : row {" fo)(write-line ": edit_box {" fo)(write-line (strcat " key = " (chr 34) "sizze" (chr 34) ";") fo)(write-line (strcat " label = " (chr 34) title (chr 34) ";" ) fo); these can be replaced with shorter value etc;(write-line " edit_width = 18;" fo) ;(write-line " edit_limit = 15;" fo)(write-line width fo) (write-line limit fo)(write-line " is_enabled = true;" fo) (write-line " }" fo)(write-line " }" fo)(write-line "ok_cancel;}" fo)(close fo)(setq dcl_id (load_dialog "c:\\acadtemp\\getval"))(if (not (new_dialog "ddgetval" dcl_id))(exit))(action_tile "sizze" "(setq item $value)(done_dialog)")(mode_tile "sizze" 3)(start_dialog); returns the value of item);(defun ah:sheetupdate1 (ss1 lay plotabs tabname dwgname)(defun ah:sheetupdate1 ()(setq doc (vla-get-activedocument (vlax-get-acad-object)))(vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)))(setq title "Please enter dwg number")(setq width " edit_width = 12;")(setq limit " edit_limit = 9;")(ah:getval title width limit)(setq dwgname item)(setq title "Please enter version for all sheets <Cr> no change")(setq width " edit_width = 8;")(setq limit " edit_limit = 5;")(ah:getval title width limit) (setq newstr4 item)(princ "0")(setq len (length plotabs))(setq x 0)(setq bname "DA1DRTXT") ; title block name(repeat len (setq tabname (nth x plotabs)) (if (/= tabname "Model") (progn (setvar "ctab" tabname) (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 bname)(cons 410 tabname)))) (setq dwgnum (Lm:parsenumbers tabname)) (setq sheetnum (car dwgnum)) (setq oldtag1 "SHT_NO") ;attribute tag name (setq newstr1 (rtos sheetnum 2 0)) (setq oldtag2 "DRG_NO") ;attribute tag name (setq oldtag3 "PROJ_NO") ;attribute tag name