sephiroth11983 Posted November 14, 2012 Share Posted November 14, 2012 (edited) Greetings, I would like to inquire about editing an LISP (got it here from Sir LEEMAC's post in "Rename Layouts") my problem is we do alot of layouts in a single cad file.. example is 150 layouts and named ex. 1001,1002,1003,1004.... then another set named 2001,2002, etc. in renaming the layouts (layoutlist) it is so time consuming to rename all when. example is the 1000 series will be renamed to 3000 series... im still trying to make my own lisp based on what i read here. but it doesnt work..obviously wrong strings. here is my lsp (being studied and edited till now sir T_T) (defun c:RAL (/ laylist xth) (setvar "cmdecho" 0) (setq laylist (layoutlist) lnum (getint "\n Layout numbering starts with? ") xth 1 ) ;_ end setq (foreach x laylist (command "-layout" "R" laylist (lnum (itoa xth))) (setq xth (1+ xth)) ) ;_ end foreach (setvar "cmdecho" 1) (princ) ) ;_ end defun I just copied Sir LEEMAC's LISP file and tried to edit it. testing it. I hope someone can help me. sir PBE, Bigal and Sir LEE Mac. ^_^ Thank you and more power Edited November 14, 2012 by sephiroth11983 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 15, 2012 Share Posted November 15, 2012 For the layouts maybe something like ; not tested (setq newtab (getint "\nEnter start number")) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (vla-put-name newtab lay) (setq newtab (+ 1 newtab)) ) Quote Link to comment Share on other sites More sharing options...
pBe Posted November 15, 2012 Share Posted November 15, 2012 (defun c:RAL (/ laylist n) (setvar "cmdecho" 0) (setq laylist (layoutlist) lnum (getint "\n Layout numbering starts with? ") ) ;_ end setq [color="blue"] (setq n (* (- lnum (/ (atoi (car laylist)) 1000)) 1000 ) )[/color] (foreach x laylist (command "-layout" "R" [color="blue"] x (itoa (+ (atoi x) n))[/color] ) ) ;_ end foreach (setvar "cmdecho" 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
sephiroth11983 Posted November 15, 2012 Author Share Posted November 15, 2012 thanks Pbe for the correction of my too many error lisp... Sir Bigal, the parameters you gave, ill try to put it in my lisp so that i can different testings... maybe in the future, i can mix up alphanumeric naming of layouts..Thanks to everyone... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 16, 2012 Share Posted November 16, 2012 Not long ago it was either Lee or PBe posted a simple way of pulling apart text that is say alphas and numbers, this way you can adjust the numbers, start with Lee-macs . ;;-------------------=={ Parse Numbers }==--------------------;; ;; ;; ;; Parses a list of numerical values from a supplied string. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; 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.