Author Topic: RENAME TABS  (Read 2109 times)

0 Members and 1 Guest are viewing this topic.

POCKETS

  • Guest
RENAME TABS
« 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

ronjonp

  • Needs a day job
  • Posts: 7529
Re: RENAME TABS
« Reply #1 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)
)
« Last Edit: July 19, 2010, 01:20:52 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

POCKETS

  • Guest
Re: RENAME TABS
« Reply #2 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:

Hangman

  • Swamp Rat
  • Posts: 566
Re: RENAME TABS
« Reply #3 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.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

POCKETS

  • Guest
Re: RENAME TABS
« Reply #4 on: July 19, 2010, 03:23:16 PM »
Thank you, one and all!
Pockets

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: RENAME TABS
« Reply #5 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

Hangman

  • Swamp Rat
  • Posts: 566
Re: RENAME TABS
« Reply #6 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
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: RENAME TABS
« Reply #7 on: July 19, 2010, 07:08:28 PM »
No worries dude :-)