Organic Posted February 19, 2013 Posted February 19, 2013 I'm not sure if it possible although I am trying to rename layout tabs an easier way. Say I have layout tabs A01 to A99 and I want to insert another layout tab at position A20. I need to rename (the old) A20 to A21, then A21 to A22 then A99 to A100 etc. Does anyone know of a fast way to do this or a lisp that does this. I've tried Lee macs TabSort lisp which is great although doesn't help much in this case. Quote
BIGAL Posted February 20, 2013 Posted February 20, 2013 Can be done the trick is to change the tab names first then add a tab, pretty sure in Lee's stuff there is a reorder tabs, you have to be carefull the tab list is different to the tab display order. Should be able to do a get tabnae and then do a put-tabname a start (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ; get its name and then maybe use a put adding +1 see add to end of text ) (setq plotabs (vl-sort plotabs '<)) You may need this also thanks to lee ;;-------------------=={ Parse Numbers }==--------------------;; ;; ;; ;; Parses a list of numerical values from a supplied string. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; 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) ) ) Quote
Organic Posted December 1, 2013 Author Posted December 1, 2013 For anyone else who happens to come across this thread, see http://www.cadtutor.net/forum/showthread.php?83243-Simple-VBA-modification for a script that does this. Quote
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.