Attributes from drawing name?

Attributes from drawing name?

DC-MWA
Collaborator Collaborator
2,928 Views
27 Replies
Message 1 of 28

Attributes from drawing name?

DC-MWA
Collaborator
Collaborator

I'm trying to find a way to use to attributes to name and number our sheets from the drawing name. Unfortunately, my autolisp skills are limited to basic layer manipulation, commands and variable settings etc. Ultimately it would be great to have a program autoload or part of our acaddoc that checks for the block and if it exists, fills in the attributes using the drawing name as desribed below.

We use a block called "MWA-SHEET". It contains two attributes, "SHEETNUMBER" and "SHEETTILE".

Sample file name: "A1.00-Sheet Title.dwg"

I need to use the "A1.00" for the "SHEETNUMBER" attribute and "Sheet Title" for the "SHEETTITLE" attribute.

I have included a sample drawing containing the "MWA-SHEET" block.

Thank you in advance for your time and input.

0 Likes
Accepted solutions (2)
2,929 Views
27 Replies
Replies (27)
Message 21 of 28

DC-MWA
Collaborator
Collaborator

That would be perfect!!! 

0 Likes
Message 22 of 28

DC-MWA
Collaborator
Collaborator

That would be perfect!

0 Likes
Message 23 of 28

dlanorh
Advisor
Advisor

Attached is updated lisp

I am not one of the robots you're looking for

0 Likes
Message 24 of 28

DC-MWA
Collaborator
Collaborator

Seems to be the same??

When in sheet drawing containing "MWA-SHEET" block, it works or gives message about file naming error. - Perfect!

 

When I'm in a drawing that does NOT contain "MWA-SHEET" block, it gives me file naming error message.

I need to look for the "MWA-SHEET" block.... if not found simply exit the program doing nothing.

0 Likes
Message 25 of 28

dlanorh
Advisor
Advisor

My apologies, I missed localising some variables so they are now global in the autocad session. Attached is an updated lisp containing a reset lisp.

Run TBLT-reset first then TBLT.

 

Edited to add the correct lisp file

I am not one of the robots you're looking for

0 Likes
Message 26 of 28

DC-MWA
Collaborator
Collaborator

Let me say I truly appreviate your efforts.

I sill get the sheet naming message on files that do not contain the block?

Example I work on sheets like "X-Base1.dwg". This drawing does not contain the block and does not need anything to happen.

In the sheet files "A1.00 - Sheet name.dwg" files it works prefect even reminding users to name correctly.

0 Likes
Message 27 of 28

dlanorh
Advisor
Advisor
Accepted solution

OK. The "penny" finally dropped. You need the lisp to quit if the block is not present BEFORE it checks the drawing name is OK.

 

Attached updated lisp should accomplish that. It will exit and return a block not present explanation on the command line.

 

If you require any more tweaks let me know.

I am not one of the robots you're looking for

0 Likes
Message 28 of 28

DC-MWA
Collaborator
Collaborator

You nailed it!!  It's perfect.

Thank you so very much for all the time you put in.

Again, if ever in Pismo Beach...  I owe you lunch to say the least.

-dc

0 Likes