Saturday, November 24, 2012

Automated Drawing List Update Acad LT (revised)

As indicated in earlier posts I use Acad LT, and automate using Excel/vba to generate AutoCAD script (.scr) file.

One of the most regularly used scripts is that for updating the drawing title blocks. This operates across multiple paperspace layouts and multiple files.

Whilst paperspace layouts can be beneficial they do have some disadvantages when it comes to repetitive detail across projects, consequently I have been tending to move back towards individual file for each drawing sheet, and lots of xref's, especially for workshop details. For example it is a lot easier to copy a file, and modify the detail, than messing around copying detail modifying and setting up new paperspace viewports. Other times it may be easier to copy layouts, and add some extra layers for some additional detail. Hence need to update drawing title blocks across multiple layouts and drawing files.

Last year I made a simple modifications, by writing the script file to a common default folder, and automatically launching Acad LT, compared to previously generating script in drawing folder and then dropping in Acad LT editor. At that time also added extra worksheets to allow different title blocks, to cover common variations: such as calc's sheets used for simple sketches, versus drawing sheet used for residential footings, and the typical drawing sheet for all other project types. To do that I also added look up tables which listed the attributes for each title block. Providing drop down lists to select which of drawings the title block script should be generated for. That was all working good, and saved a little bit of extra time over the previous version of the script.

But work shop detailing involves a lot of drawings and tend to get slightly lost in all the drawings. Also the batch of drawings did use two title blocks: proper drawing sheet and frame for the main part details and then a simple document control block for some steel sheet setouts. The current project however introduced the need for a larger sheet. Most part details are standard and on A4 sheets, but the larger building currently working on as parts which are too large to conveniently fit on A4, I can squeeze them onto A4, but have chosen to place on A3 instead.

So for the batch of drawings have three different title blocks which want to automatically update, and a problem working through all the files and details, to determine which exist and which are relevant.

So modified the Excel/vba script. It now permits each drawing to have a unique title block, on condition that it has attributes which belong to a common sets. The vba macro now checks if the attributes are in the title block, if so then writes the value from Excel to the Acad script (.scr), if not then skips to next attribute. Also the macro now checks if the drawing file exists before including in the script, if not then the cell is coloured red.

At one stage I also experimented with Hyperlinks to open the Acad drawing files from Excel worksheet, this didn't work to well because of need to keep paths updated. But now created a vba macro and short cut key (Ctrl-e), to open drawing file currently selected in the worksheet. This didn't work too well using the vba shell command as it opened each drawing in a separate instance of Acad LT. However a simple experiment with vbs, and determined that the windows scripting host (WSH), shell object run command was able to open files by association, whilst the vba shell command required the executable command. That is using vba I needed to build correct command line including reference to Acad LT as well as file name, whilst using WSH shell command only need to pass the drawing file reference. Therefore created a WScript.Shell object in Excel/vba.

So I can now get from Excel description of drawing file, to the actual Acad LT drawing. Now that is something I wanted to do for a while.

For now have potential to mesh my bill of materials (BoM), or product structure tree to workshop details, and otherwise build model in Excel. For can otherwise get lost figuring out which part files belongs to which part, and have I drawn all the necessary parts and counted them all. Sure I could buy building information model (BIM) software, but where's the fun in that. Plus BIM software is expensive and I don't have the demand for workshop detailing to justify its purchase. Programming, well that's just kind of play time.

I had experimented with XYplorer, attaching tags to part drawings, but problem with that, I need two sets of tags: one for local work on laptop, and another for files on shared drive in office. Additionally adding tags to files, produces an ever increasing database of tags which have to be scanned through. By using Excel tables, I am not adding to over head of using XYplorer, and I can add data fields as I choose on an as needs basis, sort and filter and otherwise connect to other data sources.

On BIM
One other objection I have to BIM, is that it is an enforced approach to building design, and that approach is built around 3D graphics, whilst the majority of people in the supply chain have no use of 3D graphics. Revisiting the concept of data as raw material, and information as data organised to assist decision and action, then the typical BIM software application, is a long way from being an information model. It is largely a data model BDM, and less than informative to other parties who don't want the graphics but do want to get at the data and present in formats which suit them, rather than formats that suit the authors and or users of  3D graphic software.

Consider that it is inappropriate to use a multi-million dollar flexible machining centre to make bolts and other high volume repetitive parts. It is preferable to have highly specialised machines to make bolts. The current BIM software tends towards being highly flexible, that makes it ill suited to more specialised purposes.

It is a common trend in software development that more and more features and flexibility are added, the problem is that something which previously took a few clicks now requires a multitude of irrelevant parameters to be set.

For example the modification I have just made to my spreadsheet, now requires I define the title block for each and every drawing, where as previously I only needed to identify the title block once. However, it is not a major problem because it is simple to copy cells in Excel, or to make one cell equal to another. It is that reason why I type project titles and drawing titles into Excel rather than directly into Acad.

By making software too flexible it then becomes necessary to expend time customising the software for something more specific and repetitive. The problem of creating a front end, to simplify input, is that there is a lot of over head associated with the flexibility. So whilst using an advanced flexible system may reduce development time, it does not produce a tool which is efficient. The resultant product uses more resources than necessary and operates slower than required.

Hence there is a need for custom tools. So comments like if not using the newest tools then behind the times, are largely nonsense. Should not be using the newest tools, but the tools most appropriate to the job at hand. A lot of modern software is becoming more video game than productive tool, whilst it may ease people getting familiar with the software and using, its not all that productive there after.

So some of these high end software vendors really need to pay more attention to the needs of the end-users rather than how they consider design and documentation should be carried out. There are still people producing workshop details freehand, and buildings plans freehand, that is people who are not using any form of drawing instruments and not drawing to scale: they produce simple concept sketches and that is all they need to get approval and to build. Drawing is a tool to solve problems, and many of those problems only need resolving by freehand concept sketches. So builders for example are not going to start using CAD, because drawing is not their business, they produce drawings as an aid, a means to an end. Whilst many modern architects, engineers and drafters are producing drawings as an end in itself: more concerned with document control than what is conveyed by the documents.

End-users buying BIM software also need to pay more attention to where they need productivity improvements. If 3D graphics contributes little value to an end-users activities then current array of BIM products probably of little value. That is do you really need a picture of an object to input all the other data and extract useful information about that object. If not then BIM is not a suitable solution, and other software likely to be more useful. For example MS Excel/ MS Access, or the array of MRP I, MRP II, software and various other specialist packages.

I go from Excel to Acad, because with Acad scripts (.scr) I can only really generate Acad drawings, there is little that I can do to extract Acad data other than extract block attributes, or export a DXF file, and extract data from that.

The first data for most things is symbolic, some kind of analogy, this then has to be expanded into graphics and other data. For example want a building or a machine. These are word symbols and not very specific, the definition thus has to be  refined until define something specific. This refinement can take place using more words, various kinds of charts and diagrams, or using pictorial graphics. Much can be done long before any graphics are produced, but seems in the modern world consultants dive straight into CAD drawings, when should have dismissed an idea almost immediately using simple freehand sketches.

A crazy world in which it seems only typed reports and CAD drawings seem to be accepted. Very wasteful.


Related Posts:

AutoCAD Speed Test
Automated Drawing List Update Acad LT (revised)

Cold-Formed Steel Shed Industry: part:#1 (Shed Framing Drawings)
Cold-Formed Steel Shed Industry: part:#2 (Shed Framing Drawings)