布局图纸空间重新编号
大家好,圣诞快乐。进展祝你新年快乐
我正在寻找自动重新编号的纸张空间文字或属性块每个布局。
我有25到60个布局
谢谢,问候
yathishkumar先生 显示一个包含更多详细信息的示例 请查找随附的图纸文件
示例文件
谢谢问候
yathishkumar先生
图纸6.dwg 您可以进行各种自动重新编号,我们可以阅读dwg图纸NUB的布局选项卡,您可以从1开始重新编号,等等。
唯一需要注意的是,简单来说,布局有两个列表——你看到它们的顺序和它们创建的顺序——通常我们使用你看到它们的顺序。
那么如何保存布局呢?剩下的很简单。
; 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)
)
)
;; InputDialog 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
(setq newstr3 dwgname)
(setq oldtag4 "REV_NO") ;attribute tag name
; if less than 10
(if (< (car dwgnum) 10.0)
(setq newstr2 (strcat dwgname "-D0"(rtos sheetnum 2 0)))
(setq newstr2 (strcat dwgname "-D"(rtos sheetnum 2 0)))
)
(foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 0 )) 'getattributes)
(if (= oldtag1 (strcase (vla-get-tagstring att)))
(vla-put-textstring att newstr1)
) ; end if
(if (= oldtag2 (strcase (vla-get-tagstring att)))
(vla-put-textstring att newstr2)
) ; end if
(if (= oldtag3 (strcase (vla-get-tagstring att)))
(vla-put-textstring att newstr3)
) ; end if
(if (and (/= newstr4 nil) (= oldtag4 (strcase (vla-get-tagstring att))) )
(vla-put-textstring att newstr4)
) ; end if
) ; end foreach
) ; end progn
) ; end if
(setq x (+ x 1))
) ; end repeat
(setq ss1 nil)
) ; end defun ah
(ah:sheetupdate1)
(princ)
“布局”是指图纸空间布局?如果是的话,这对于一幅画来说是惊人的多。
或者这是序列号,但图形只有一个布局选项卡?如果是,您最好使用图纸集管理器(SSM)。 Pbe我在一个民用道路设计图纸中有88个布局,毫无疑问,如果是ssm,它将不起作用,因为我们使用了第三方产品,并通过剪切和粘贴更新设计来更正图纸。看到我的帖子,通过一个数字跳转到任何布局,我相信即使在2015年也会遗漏一些东西。
哇,以前从没这么做过。
这是一个好主意,类似于卓越的“激活”能力。
至于OPs发布的图形文件。你认为Fields value适用吗
ctab+1
ctab-1
思想?
我附上了一张图纸,以证明我所说的ctab+/-1是什么意思
图纸6.dwg Pbe使用一个字段很好,我们通常将布局标记为D01 d02等。在88个布局中,我们再次使用D54FRED ST,因此使用Lee mac例程仅检索数字。该例程对布局进行计数,因此第二部分是第1页,共88页。删除一张图纸将成为第1页,共87页。然后使用DWGINDEX。lsp更新主索引。原始图纸对所需内容有点吹牛。
这是布局链接的多个功能http://www.cadtutor.net/forum/showthread.php?84430-移动布局重命名布局转到布局 感谢您发布链接BIGAL,GOTO确实帮助用户跳转到特定的布局选项卡,我记得我以前用一个列表框写过类似的东西,我添加了该功能,因为用户要求使用从模型到图纸空间布局的创建“字段”值。
回到OP,post#4的代码中似乎缺少函数AH:GETVAL?最好测试一下代码。 你好
让我试试
但我有不同的选项卡名称和图纸名称是不同的。
谢谢,regardes
雅提斯库马尔
页:
[1]
2