Jump to content

Recommended Posts

Posted

I'm looking to use DIESEL expressions to automate some of the work involved in filling in title block attributes for drawings. Specifically, I'm looking to fill in a drawing number field, two drawing title fields and a revision field, each of which I would like to be populated with different substrings of the drawing file name.

 

My drawing filenames following the following format:

 

0000-00-0000 Customer Name - Drawing Title Rev X

 

...where the leading digits will be different each time but always in the 4-2-4 format shown, followed by a customer/client name (the length of which will vary from customer to customer), followed by a hyphen and then a title for the specific drawing (again, the length of this field is variable). Finally, a revision number is appended to each file prefixed by 'Rev'; this could potentially by anything, but in practice will likely by a single letter (for example. 'A') or a number ('0.1', 2, or 11, to give examples). It's unlikely to be anything other than those, but I mention this just to point out that it could come in a number of different formats and isn't locked into being a single character.

 

I've used the following expression:

 

$(substr, $(getvar,dwgname), 2, 12)

 

...to give me my drawing number field, and it works well. Deriving the other fields is proving much tricker though, given that they're not of a fixed length. Does anyone know how to consistently pluck these values out of the drawing filename?

Posted

If you can use  a lisp instead much easier, your profile says LT2019 so a problem.

 

It may be worthwhile looking at Bricscad as it has Lisp and is an up to date program, you can purchase a perpetual license. 

Posted

Thanks for replying. There's a distinct possibility that I might be getting an upgrade to LT 2025 pretty soon, and from what I've seen that should have Lisp support.

 

Know of any good Lisp reference sources?

Posted

I've attached a copy of the template I'm working from. It identifies where I work but hey, does anyone really care?

 

You can see from this how I've been able to populate a few fields in the title block using some very basic DIESEL expressions, but I'm having trouble populating the TITLE1 and TITLE2 attributes in the same fashion. I'd like if all these attributes can be derived from the filename if possible as it reduces the number of places that info has to be entered in.

 

Thanks for the LISP reference. Some nice light reading to go through there, by the looks of it!

9999-00-1001 A1 Project - Description Rev 0.1.dwgFetching info...

Posted

Just a comment as previously mentioned if you have lisp can get what you want as different values. One of the lisps I have is for multiple title blocks in layouts, just fill in one title block and all the details are copied to the other layouts. Stuff like rename  & renumber layouts etc.

Posted

If still stuck with LT and no LISP, you might look into leveraging EXCEL.

 

There was a member here did a whole lot of stuff with LT and Excel before LT had basic LISP ability.

 

No guarantee that what you need done can be done in newer LT with LISP as it has limitations.

 

I'll check your drawing when I return to work Monday.

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...