Jump to content

Recommended Posts

Posted

Hi all!

 

I am just starting to learn Autolisp and my friend at work has a problem and I couldn't think of the solution, so I thought I'd ask for help.

 

He details concrete panels in Autocad and he may have 40+ tabs in a single file, with a standard title block that includes the client's name, address, panel number, page number, total number of pages etc.

 

Lets say there's a change and a new tab has to be inserted, he has to manually edit every single title block to reflect the new page numbers!

 

What he's after is a lisp routine that does this automatically. The page number and the total number of pages are just attributes in the title block.

Posted

Sounds like it would not be too difficult. The tabs are for Paperspace, I assume, though I’m not sure that would really matter. The important thing would be the block name of the titleblock, and of course the two tags for pages & page#s. One solution would be along the following lines:

 

 

Insert the new tab and titleblock, but with a dummy #, e.g., X, to keep it from duplicating what is already there and to ID it as the new one. If all the page numbers are numeric and this dummy ID is non-numeric, then it will be easy for the program to recognize it.

  1. Have the routine get the new page# from the user.
  2. Also get the new total number of pages.
  3. Run a selection set filter
    (ssget     “X” ...) 

    to get all the titleblock blocks.

  4. Change the attribute for the total pages (same for each block).
  5. Add 1 to the page number for each of the pages above the new number.
  6. Change the dummy ID to the new page number being added.

Posted

Welcome to CADTutor Bernie.

 

Here are the steps you would need to follow in order to create the program you require:

 

  • Collect a Selection Set of all Titleblocks in the drawing.

 

  • Iterate over the set and construct a list of lists wherein each sublist contains the Layout name and Titleblock object (or entity) residing in that Layout.

 

  • Sort the list using the order of the Layouts in the drawing (TabOrder property of the VLA Layout Object).

 

  • For each item in the sorted list, modify the attribute in the Titleblock using an incrementing counter whilst iterating over the list.

If the task is beyond your ability, contact me through my site and I would be more than happy to write the application for you (for a small fee).

 

Cheers,

 

Lee

Posted
Hi all!

 

I am just starting to learn Autolisp and my friend at work has a problem and I couldn't think of the solution, so I thought I'd ask for help.

 

He details concrete panels in Autocad and he may have 40+ tabs in a single file, with a standard title block that includes the client's name, address, panel number, page number, total number of pages etc.

 

Lets say there's a change and a new tab has to be inserted, he has to manually edit every single title block to reflect the new page numbers!

 

What he's after is a lisp routine that does this automatically. The page number and the total number of pages are just attributes in the title block.

 

So... Why aren't you using Sheet Set Manager with Attributed Title Block(s) which reference the Sheet Set Properties? :unsure:

Posted

The steps I provided assumed a new insertion as originally stated. It’s pretty simple. But if you go changing the Layout tabs around so that the page numbers are no longer applicable due to disorder (not just a new page/tab), then you will certainly need smth like what Lee describes. If you’re going to invest in it, then Lee’s method is more versatile and the right way to go, as it should work in any case, as long as the tabs themselves are in the correct order. And if they weren’t, you could simply move them so that they are, then rerun the program. If you go by tab order, the program could also rename the tabs, if it knows the correct format.

Posted

Go check the other post its been updated with a soloution.

 

This is two posts asking the same question at the same time.

Posted
Go check the other post its been updated with a soloution.

 

This is two posts asking the same question at the same time.

 

Yes, the other post does seem to have a possible solution to this problem, though it seems to me that this one is asking about titleblocks with attributes, whereas the other is asking about the layout tabs themselves.

Posted

Neophoible the other post by me has the link to a lisp example of how to change multiple attributes based on layout naming and user input.

Posted
Neophoible the other post by me has the link to a lisp example of how to change multiple attributes based on layout naming and user input.

 

Thanks, BigAl. Didn't mean to sound disagreeable. :oops: My real point should have been not to simply read the differing Qs, but rather to look at your offered solution to cover both. My bad for not making it clear that way. I hope everyone will understand now--go look at how the solution applies to your Q.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...