yathishkumar Posted December 25, 2014 Share Posted December 25, 2014 Hi all happy merry Christmas. advance. wish you happy new year i am looking for auto renumber each layout on paper space text or attribute block. i have 25 to 60 layouts thanks,regards yathishkumar Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 25, 2014 Share Posted December 25, 2014 Show an example with more details Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted December 25, 2014 Author Share Posted December 25, 2014 please find the attached drawing file sample file thanks regards yathishkumar Drawing6.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 25, 2014 Share Posted December 25, 2014 (edited) You can do all sorts of auto renumber, we do read layout tab for dwg sheet numb, you can renumber all starting with 1 etc. The only thing to be careful of is the layouts in simple terms have two lists the order you see them and the order they were created in generally we use order you see them. So how do you save your layouts the rest is easy. ; 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 (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) Edited December 28, 2014 by BIGAL Quote Link to comment Share on other sites More sharing options...
pBe Posted December 26, 2014 Share Posted December 26, 2014 i have 25 to 60 layouts By "layout" you mean paper space layout? If yes, that is surprisingly a lot for one drawing. Or is that the series number but the drawing has only 1 layout tab? If yes, you are better off using Sheet Set Manager (SSM) me thinks. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 26, 2014 Share Posted December 26, 2014 Pbe I have 88 layouts in one civil road design dwg no probs it just would not work if it was ssm as we have use a 3rd party product and cut and paste update design to correct sheet. See my post re GOTO jumps to any layout via a number something thats missing I believe even in 2015. Quote Link to comment Share on other sites More sharing options...
pBe Posted December 27, 2014 Share Posted December 27, 2014 Pbe I have 88 layouts in one civil road design dwg no probs Wow, never done that before. See my post re GOTO jumps to any layout via a number something that's missing I believe even in 2015. That's a great idea, similar to Excels "activate" capability. As for the OPs posted drawing file. Would you think Fields value would work for ctab+1 ctab-1 Thoughts? I attached a drawing to demonstrate what i meant by ctab +/- 1 Drawing6.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 27, 2014 Share Posted December 27, 2014 Pbe thats good using a field we generally label our layouts D01 d02 etc in the 88 layouts we again have D54FRED ST hence the use of the Lee-mac routine to retrieve the number only. The routine counts the layouts so part two is sheet 1 of 88 remove a sheet becomes sheet 1 of 87. Then use DWGINDEX.lsp to update the master index. The original dwg is a bit vauge about what is required. Here is the layout link multiple functions http://www.cadtutor.net/forum/showthread.php?84430-Move-layout-Rename-layouts-Goto-layout Quote Link to comment Share on other sites More sharing options...
pBe Posted December 28, 2014 Share Posted December 28, 2014 Thank you for posting the link BIGAL, GOTO sure does help the user to jump to a specific layout tab, i remember i wrote something like this before with a listbox , i added that feature as the user requested to use a create "Field" value from model to paperspace layout. Going back to the OP, the function AH:GETVAL seems to be missing on the code at post#4? It would be nice to test the code. Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted December 28, 2014 Author Share Posted December 28, 2014 Hi let me try but i have tab name different and drawing name is different. thanks,regardes yathiskumar Quote Link to comment Share on other sites More sharing options...
pBe Posted December 28, 2014 Share Posted December 28, 2014 The original dwg is a bit vague about what is required. yathiskumar, Please post a "realistic" drawing sample, just remove all the confidential info on the drawing file. but i have tab name different and drawing name is different. Still not a good description of what you require. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 28, 2014 Share Posted December 28, 2014 Added Getval to my post above I use this globally so it sits outside of most routines, just a nicer way to ask for a value than the command prompt. Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted December 31, 2014 Author Share Posted December 31, 2014 please find the attachments i can't upload full drawing it is huge file tab name should be 1b,2b,3c etc..... layout should be 5001 etc.... thanks yathishkumar RIYDS2-MOU-LB2-PP-DR-5001 TO 5039.dwg Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 31, 2014 Share Posted December 31, 2014 (edited) This program is to rearrange the position of layouts alphabetically . Removed ... Edited December 31, 2014 by Tharwat Quote Link to comment Share on other sites More sharing options...
yathishkumar Posted December 31, 2014 Author Share Posted December 31, 2014 hi i am looking for tab custom name maybe changing every time with different drawings. layout should be in numeric numbers like. what u send in previous post with drawing is working. but tab name should be in my previous post thanks yathishkumar Quote Link to comment Share on other sites More sharing options...
pBe Posted January 6, 2015 Share Posted January 6, 2015 layout should be 5001 etc.... Not sure what that means yathishkumar How would the program determine when its 1b 1c or 1-1 1-2? This should be fun to code if only i understand what is it you want Quote Link to comment Share on other sites More sharing options...
Organic Posted January 9, 2015 Share Posted January 9, 2015 By "layout" you mean paper space layout? If yes, that is surprisingly a lot for one drawing. The job (highway work) I spent 6 weeks working on at the end of last year had 130 something paperspace layouts in it. Subdivision work tends to have a fair few sheets also. General ballpark figure that works most of the time for subdivision design is that there will be about 2.5x as many sheets (paperspace layouts) as there are lots in the stage. So if it is a 6 lot subdivision stage, there will be about 18 sheets. If it is an 30 lot subdivision stage there will be about 75 sheets etc - obviously depends heavily on the road configuration and lot layout though. I use LeeMacs 'TabSort' lisp has a 'current' button to jump to the different paperspace layouts I want. Quote Link to comment Share on other sites More sharing options...
Organic Posted January 9, 2015 Share Posted January 9, 2015 Pbe I have 88 layouts in one civil road design dwg no probs it just would not work if it was ssm as we have use a 3rd party product and cut and paste update design to correct sheet. See my post re GOTO jumps to any layout via a number something thats missing I believe even in 2015. Why would it not work if you use SSM (I don't use it but are looking to possibly use it)? We also use a 3rd party program for design. Quote Link to comment Share on other sites More sharing options...
pBe Posted January 9, 2015 Share Posted January 9, 2015 The job (highway work) I spent 6 weeks working on at the end of last year had 130 something paperspace layouts in it.... I understand all that Orgnanic. Bigal already schooled me on the error of my ways I still have not heard anything from the the OP. probably found a solution elsewhere. oh well. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 10, 2015 Share Posted January 10, 2015 Organic/Pbe following on where is op? When we create long cross etc from 3rd party we have a lisp that cuts current layout and pastes to a different layout ie updates sheet. Hence not sure how I would do this in sheet sets. Just a quick note 3rd party developer is working on finding the part of the dwg any where and auto updating. Organic you may like to have a look at my "goto.lsp" (see previous post change 99 to 999) like you with 88 layouts just jump to 22, I have it autoloaded so ready to go. 2015 has a scrolling list but a pain still, at 133 scroll to 10 ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.