We are currently fielding the drawing number in our title blocks from the file name. Typical format would be 123456-SR-100-40-1001.dwg for the drawing name which would appear the same in the title block. We then had a separate field for the tab number.
What we want to do in the title block is replace the last two digits of the filename with the tab number, We would change the filename to 123456-SR-100-40-10XX, the tab names would be numbered 01, 02, 03 etc, and the drawing number in the title block would appear as 123456-SR-100-40-1001, 123456-SR-100-40-1002, 123456-SR-100-40-1003 etc.
Can this be done by manipulating the filename field expression? Or would we have to use a different (custom) field expression? Can we even do this with fields?
If you are trying to have the file name as a field, with the last 2 digits as the layout tab number I don't think you can do this as a field.
You can use the file name as field (leave off the last two digits) so your file name would be 123456-SR-100-40-10
and append this with Rtext using a diesel expression $(getvar, "ctab")
If you number multiple layout tabs in your drawing simply as 01, 02, 03 etc. this diesel expression will return those values.
That's beautiful! It's very close. We can't use ctab because we're also generating drawing indexes from here, and ctab only reports whatever tab was current when the drawing was last saved. I thought of saving the active tab as a variable that stayed constant - can that be done in diesel?
I'll have to take a closer look at the ctab issue - I had it on hearsay so never tried it myself. What you've done is very close to what we're after though - so thanks!
We use EATTEXT to spit out the drawing list into a table object.
Okay, I made a test file with five tabs numbered 01 through 05. I inserted your diesel into each, and in the title block, the numbers appear perfectly because ctab is pulling the name of the current tab. Then I changed to model space and closed the drawing. I ran EATTEXT in a new drawing and got what you see in the attached. I think CTAB always returns the current tab (the model tab in this case), and I'm looking for a way to make the tab number stick. (Obviously, the list should read 2101, 2102, 2103 etc, as it does in the title blocks themselves.
I know nothing about diesel and next to nothing of autolisp, but is there a way to do something like (setq tabno (getvar "ctab")) in the second expression? I believe (could be wrong!) that would make a sticky value in that field.
There is nothing like moving the goal posts, your original post only asked for a field within the drawing title, unfortunately there is no other way to get tab information that I know of, someone with Lisp experience may be able to help you further.
Access a broad range of knowledge to help get the most out of your products and services.