Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename a layout tab-quickly?

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
302 Views, 10 Replies

Rename a layout tab-quickly?

Is there a routine that will allow a person to rename a layout tab simply by
clicking on it? Istead having to right click and rename?
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

Here's one function I use as part of routine to rename current layout,
should give you some ideas of how to adapt to do what you want.
;layout func by Mark Propst
;4-29-02

(defun adcxRenameCurrentLayout (adcvNewName)
(vl-load-com)
(vlax-put-property
(vla-item
(vla-get-layouts
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(getvar"CTAB")
)
'Name
adcvNewName
)
)


"Albert Giuliano" <1@AOL.COM> wrote in message
news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> Is there a routine that will allow a person to rename a layout tab simply
by
> clicking on it? Istead having to right click and rename?
>
>
Message 3 of 11
Anonymous
in reply to: Anonymous

Here is a similar approach to what Mark posted

(defun RenameCtab (String)
(vl-load-com)
(vlax-put-property
(vla-get-activelayout
(vla-get-activedocument
(vlax-get-acad-object)
)
)
'Name
String
)
(princ)
)

You should account for the model tab though.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


"Albert Giuliano" <1@AOL.COM> wrote in message
news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> Is there a routine that will allow a person to rename a layout tab simply
by
> clicking on it? Istead having to right click and rename?
>
>
Message 4 of 11
Anonymous
in reply to: Anonymous

Ok I looked at both, They load fine, But I can't seem to figure where in the
code to place a prompt for selection the tab and intiate the Dialog box that
allow you to rename the tab, any help would be appreciated.


"Jason Piercey" wrote in message
news:5E262EE5B23312AB528EE2DEDEEB7127@in.WebX.maYIadrTaRb...
> Here is a similar approach to what Mark posted
>
> (defun RenameCtab (String)
> (vl-load-com)
> (vlax-put-property
> (vla-get-activelayout
> (vla-get-activedocument
> (vlax-get-acad-object)
> )
> )
> 'Name
> String
> )
> (princ)
> )
>
> You should account for the model tab though.
>
> --
> -Jason
>
> Member of the Autodesk Discussion Forum Moderator Program
>
>
> "Albert Giuliano" <1@AOL.COM> wrote in message
> news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> > Is there a routine that will allow a person to rename a layout tab
simply
> by
> > clicking on it? Istead having to right click and rename?
> >
> >
>
>
Message 5 of 11
Anonymous
in reply to: Anonymous

That can be done with a reactor only, but I do not see any advantage on
doing this.

"Albert Giuliano" <1@AOL.COM> wrote in message
news:3795BA286A1F7BE5A4C5918FF1837BE0@in.WebX.maYIadrTaRb...
> Ok I looked at both, They load fine, But I can't seem to figure where in
the
> code to place a prompt for selection the tab and intiate the Dialog box
that
> allow you to rename the tab, any help would be appreciated.
>
>
> "Jason Piercey" wrote in message
> news:5E262EE5B23312AB528EE2DEDEEB7127@in.WebX.maYIadrTaRb...
> > Here is a similar approach to what Mark posted
> >
> > (defun RenameCtab (String)
> > (vl-load-com)
> > (vlax-put-property
> > (vla-get-activelayout
> > (vla-get-activedocument
> > (vlax-get-acad-object)
> > )
> > )
> > 'Name
> > String
> > )
> > (princ)
> > )
> >
> > You should account for the model tab though.
> >
> > --
> > -Jason
> >
> > Member of the Autodesk Discussion Forum Moderator Program
> >
> >
> > "Albert Giuliano" <1@AOL.COM> wrote in message
> > news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> > > Is there a routine that will allow a person to rename a layout tab
> simply
> > by
> > > clicking on it? Istead having to right click and rename?
> > >
> > >
> >
> >
>
>
Message 6 of 11
Anonymous
in reply to: Anonymous

I thought the intent here was to make it simple? Using the code provided to
prompt the user then load a dialog box seems much more complicated than just
Right Click-> Rename.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> But I can't seem to figure where in the
> code to place a prompt for selection the tab and intiate the Dialog box
that
> allow you to rename the tab
Message 7 of 11
Anonymous
in reply to: Anonymous

I did try to use the defun line command "RenameCtab" to start the routine,
but it kept coming back with an unknown command error, so I figured perhaps
selection option was yet to be inserted.


"Jason Piercey" wrote in message
news:07E9E92032254A6F5B558AF52F52056E@in.WebX.maYIadrTaRb...
> I thought the intent here was to make it simple? Using the code provided
to
> prompt the user then load a dialog box seems much more complicated than
just
> Right Click-> Rename.
>
> --
> -Jason
>
> Member of the Autodesk Discussion Forum Moderator Program
>
>
> > But I can't seem to figure where in the
> > code to place a prompt for selection the tab and intiate the Dialog box
> that
> > allow you to rename the tab
>
>
Message 8 of 11
Anonymous
in reply to: Anonymous

What has been posted are functions, not commands. To use a function you
must enclose it in a set of "( )" and provide the required arguments (if
any).

(RenameCtab "YourNewTabName")

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> I did try to use the defun line command "RenameCtab" to start the routine,
> but it kept coming back with an unknown command error, so I figured
perhaps
> selection option was yet to be inserted.
Message 9 of 11
Anonymous
in reply to: Anonymous

How can I use this file, ...

"Mark Propst" schreef in bericht
news:3443880449534477B12CA8EBB19DA034@in.WebX.maYIadrTaRb...
> Here's one function I use as part of routine to rename current layout,
> should give you some ideas of how to adapt to do what you want.
> ;layout func by Mark Propst
> ;4-29-02
>
> (defun adcxRenameCurrentLayout (adcvNewName)
> (vl-load-com)
> (vlax-put-property
> (vla-item
> (vla-get-layouts
> (vla-get-activedocument
> (vlax-get-acad-object)
> )
> )
> (getvar"CTAB")
> )
> 'Name
> adcvNewName
> )
> )
>
>
> "Albert Giuliano" <1@AOL.COM> wrote in message
> news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> > Is there a routine that will allow a person to rename a layout tab
simply
> by
> > clicking on it? Istead having to right click and rename?
> >
> >
>
>
Message 10 of 11
Anonymous
in reply to: Anonymous

How must I use such a code into AutoCAD

"Mark Propst" schreef in bericht
news:3443880449534477B12CA8EBB19DA034@in.WebX.maYIadrTaRb...
> Here's one function I use as part of routine to rename current layout,
> should give you some ideas of how to adapt to do what you want.
> ;layout func by Mark Propst
> ;4-29-02
>
> (defun adcxRenameCurrentLayout (adcvNewName)
> (vl-load-com)
> (vlax-put-property
> (vla-item
> (vla-get-layouts
> (vla-get-activedocument
> (vlax-get-acad-object)
> )
> )
> (getvar"CTAB")
> )
> 'Name
> adcvNewName
> )
> )
>
>
> "Albert Giuliano" <1@AOL.COM> wrote in message
> news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> > Is there a routine that will allow a person to rename a layout tab
simply
> by
> > clicking on it? Istead having to right click and rename?
> >
> >
>
>
Message 11 of 11
Anonymous
in reply to: Anonymous

you could write a lisp command to call this lisp function, then either enter
the lisp command at command line, put on a tool bar or put in a menu item.
ex:
(defun c:ChangeLayoutName ( )
(adcxRenameCurrentLayout (getstring "\nEnter new name for current layout"))
(princ)
)
note: as pointed out earlier in thread this code has no error checking to
make sure you're currently on a pspace layout tab.
It won't work if you're in model space.
(this was just for an idea of where to start - your requirements may need
various adjustments.)

"Rotor bv" wrote in message
news:B56A2477CB484087EBA8AF68105FEDE8@in.WebX.maYIadrTaRb...
> How must I use such a code into AutoCAD
>
> "Mark Propst" schreef in bericht
> news:3443880449534477B12CA8EBB19DA034@in.WebX.maYIadrTaRb...
> > Here's one function I use as part of routine to rename current layout,
> > should give you some ideas of how to adapt to do what you want.
> > ;layout func by Mark Propst
> > ;4-29-02
> >
> > (defun adcxRenameCurrentLayout (adcvNewName)
> > (vl-load-com)
> > (vlax-put-property
> > (vla-item
> > (vla-get-layouts
> > (vla-get-activedocument
> > (vlax-get-acad-object)
> > )
> > )
> > (getvar"CTAB")
> > )
> > 'Name
> > adcvNewName
> > )
> > )
> >
> >
> > "Albert Giuliano" <1@AOL.COM> wrote in message
> > news:98D4D3F405D4F85FF491824396B15F96@in.WebX.maYIadrTaRb...
> > > Is there a routine that will allow a person to rename a layout tab
> simply
> > by
> > > clicking on it? Istead having to right click and rename?
> > >
> > >
> >
> >
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost