Common data across multiple drawings *or* Trigger LISP script before plot or REGEN command

What I'm trying to do is have a series of MTEXT fields that reference things like voltage, amp draw, UL file number, and product part number. For each product, there are 4-5 *.DWGs that share this information. It's referenced in terminal block labeling, title blocks, nameplate labeling, and so forth. It's getting cumbersome to keep every line of text updated in all the different places. My aim is to update one document and have it pulled into all the others automatically thereafter. I tried blocks and attributes.... but you can't duplicate and move the attribute tags independent of the block. I tried an excel file with a linked table and MTEXT cell references...but it only worked with numbers. Using strings of text just produced something like "#######." I've also looked at sheet sets and sheet set variables. However, data entry into sheet set variables seemed more tedious than just manually updating documents.

The only thing that seemed to work in a usable manner was loading an excel file with LISP and populating LISP variables, which I then reference in MTEXT fields. It seems kinda overkill though. It also slows down opening the *.dwg because it requires running the script upon loading the drawing. Even then, I haven't worked out how to REGEN automatically to update fields if the values changed.

So, first question .... have I missed an alternative?
Seems like it should be a relatively standard problem. Common enough that there aught to be a built-in solution.

Secondly, I want to make sure that the information is extracted and updated before plotting.
Someone may open the drawing, edit the excel file, and then print....which would print incorrect values. You must re-run the script and then regen before plotting.
Is there a means of triggering a LISP script before the plot window appears? Can LISP scripts force a regen command?


  • Here is something that may be of interest. It is a small example to demonstrate how global Lisp variables can be used in fields. Reactors are used to update fields.

  • I may not be far enough along to understand what is happening there.
    I hadn't heard of LISP until a couple of weeks ago. I normally program in ladder logic or C#.
    On a certain level, I get it...but there's a lot that I don't know.

    I'll see what I can learn from it. But it mostly looks like gobbledygook and magical voodoo at this stage.

  • Jason Bourhill
    edited May 25

    Few things you could consider:

    • Try using RTEXT. This feature is largely deprecated by the introduction of FIELDs, but I believe RTEXT has the option to link to a text file for its content. RTEXT is included in Express tools for BricsCAD. Roy might be able to talk to this more on whether it's an option.
    • DWGPROPS allows you to create custom properties that you can link to using a FIELD. You would need to create a routine that updated the custom DWGPROPS on opening. This is quite robust as everything required is maintained within the drawing. I've seen document management applications use this technique.
    • Use a SHEETSET to hold your common data. This data is held in a .dst file in the same folder as the drawings. You can link to Sheetset data using a FIELD. The advantage of this option is that it would require no programming.

    Jason Bourhill
    BricsCAD V21 Ultimate
    CAD Concepts

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!