TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: POCKETS on July 19, 2010, 12:56:44 PM

Title: RENAME TABS
Post by: POCKETS on July 19, 2010, 12:56:44 PM
Cab,
I came across your lisp program, re-name-layouts and I was wondering if that program could be modified to just rename layout1 to paper?
Using AutoCAD 2008
Pockets
Title: Re: RENAME TABS
Post by: ronjonp on July 19, 2010, 01:04:35 PM
Try something like this:
*added defun
Code: [Select]
(defun c:younameit (/)
  (if (member "Layout1" (layoutlist))
    (vla-put-name
      (vla-item (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
"layout1"
      )
      "paper"
    )
  )
  (princ)
)
Title: Re: RENAME TABS
Post by: POCKETS on July 19, 2010, 01:16:11 PM
Ronjonp,
This work great!
Next request, how do I set this up so that I can use a button to activate it?
I am use to working with defun c:
Title: Re: RENAME TABS
Post by: Hangman on July 19, 2010, 02:06:44 PM
Depending on the version you are running, just put the command (younameit) into the Macro line (I'm looking at 2010).
So, for 2010 for example:  C^C^_younameit
Be sure the routine Ron provided is in a directory that AutoCAD looks at.
In the older versions there is an <MNS ??> file you would need to edit.  I don't recall the layout so I can't post an example here for you, but I know it's somewhat similar.
Title: Re: RENAME TABS
Post by: POCKETS on July 19, 2010, 03:23:16 PM
Thank you, one and all!
Pockets
Title: Re: RENAME TABS
Post by: Lee Mac on July 19, 2010, 05:38:31 PM
So, for 2010 for example:  C^C^_younameit

Not trying to be picky, but I thought it was ^C^C
Title: Re: RENAME TABS
Post by: Hangman on July 19, 2010, 07:06:38 PM
So, for 2010 for example:  C^C^_younameit

Not trying to be picky, but I thought it was ^C^C

I thought it looked funny when I wrote it, ...  I'll blame it on the fat fingers.  :-D
Title: Re: RENAME TABS
Post by: Lee Mac on July 19, 2010, 07:08:28 PM
No worries dude :-)