Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I am unable to get it to work, probably because im pretty new to Autolisp. Can i get more direction?
Thanks
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
bdcurry wrote:I am unable to get it to work, probably because im pretty new to Autolisp. Can i get more direction?
Thanks
If you can tell us whats happening when you say unable to get it work. and it wouldnt work for text/mtext.
whats the error message if any?
As i explained from the previous post, there are strings that are considered invalid characters "<>/\":;?*|,=`" for layout name
Mtext usually have the "\\P" , code for new line. you probably didnt notice the error message after you click on a text/mtext with invalid characters. it would say at the command prompt
The following characters are not valid in layout names: <>/\":;?*|,=`
Is that whats happening on your case? If not the, post a sample drawing and we'll figure out together
Help us help you......
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
A quick mod [not tested]
(defun C:RTT (/ str) ; = Rename Tab to match Text
(if (and (/= (getvar 'ctab) "Model")
(setq str (cdr (assoc 1 (reverse
(entget (car (nentsel
"\nSelect Text/Mtext/Attribute to change Layout Tab name to its content: "
))))))))
(progn
(foreach kk '("\\P" "<" ">" "/" "\\" ":" ";" "?" "`*" "|" "," "=" "``")
(while (vl-string-search kk str)
(setq str (vl-string-subst (if (eq kk "\\P") " " "") kk str))
))
(command "_.layout" "_rename" (getvar 'ctab) str)
)
(prompt "\nCannot rename Model space tab.")
)
(princ)
)
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Ok the problem is that my Attributed block has multiple lines and it only renames the layout with one line..
Example..."Chilled Beam Cooling Water Diagram" is the full title
Each part of the title is didvided like this in the block...
Sheet title 1 = Chilled Beam
Sheet title 2 = Cooling Water
Sheet Tile 3 = Diagram
When i select the block it only renames the layout with "Chilled Beam"
or if i click "Cooling Water" it will rename the layout "Cooling Water" and so on...it will only read one line of the block.
I need it to read all three lines of the block and rename accordingly. Is there a way to have it rename it by the Tag or Prompt within the block? (fyi most on my blocks will have 5-7 lines of info)
i just tested the text/mtext title and it is working with the new lisp you sent above. Thanks!
I have atttached an example for the block.
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
bdcurry wrote:Ok the problem is that my Attributed block has multiple lines and it only renames the layout with one line..
Example..."Chilled Beam Cooling Water Diagram" is the full title
Each part of the title is didvided like this in the block...
Sheet title 1 = Chilled Beam
Sheet title 2 = Cooling Water
Sheet Tile 3 = Diagram
When i select the block it only renames the layout with "Chilled Beam"
or if i click "Cooling Water" it will rename the layout "Cooling Water" and so on...it will only read one line of the block.
I need it to read all three lines of the block and rename accordingly. Is there a way to have it rename it by the Tag or Prompt within the block? (fyi most on my blocks will have 5-7 lines of info)
i just tested the text/mtext title and it is working with the new lisp you sent above. Thanks!
Kudos to Kent Cooper, It was really his idea. ![]()
As for your request, i can think of a couple ways to do that. easiest way is to use TAG names but it would be specific to a particular block. perhaps a prompt would be better .. we'll see, but it will have to wait till tomorrow .
Cheers
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I thought about this and made some test codes. I believe the best way to deal with attributes is to use a listbox. That way you can select the strings you want to use as layout name. But only if you select an attribute.
The TAG reference is a good idea,but i would prefer to make the code generic .
usage:
command: RTT
If selected entity is an attribute this will appear
HTH
Re: naming a single layout tab to match the file name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Works Perfect!!!
Thank you all for your work in solving this for me.


