PDA

View Full Version : 2012 Scripting: Revisions to Titleblock - Best Way?



nickroz
2011-12-15, 10:49 PM
The firm I work at uses Vanilla 2012 like it's 1980s pencil drafting - all linework, everything done manually, everything exploded. I'm trying to take baby steps to alleviate the monotony and speed up the workflow.

My current goal is getting project revision numbers, descriptions and dates to individual sheets in a dynamic manner. I have gotten everyone at the firm comfortable with using DWGPROPS, but I will need to script them in some manner. Sheet Set Manager may be an option to implement, but will require more staff training.

Project setup:
Each sheet drawing has one sheet layout (paperspace) that references a single project titleblock as an xref. Currently we go into each sheet and copy/paste the delta block, revision description and revision date as an MTEXT.

Goal:
1. To have the master revision list in the project titleblock with revision descriptions and dates (as Block Attributes or DWGPROPS)
2. To set custom DWGPROPS in each sheet when they're affected by revisions (Rev01=no,Rev02=yes)
3. To have each sheet's titleblock revision table dynamically pull data from the project titleblock (rev number, date, description) and display based on whether the revision affects the sheet.
4. To have the sheet's revision table (either MTEXT or TABLE) "stack" revisions so there aren't blank spaces in-between lines (if #1 and #3 affect the sheet, there's no blank space for the missing #2 rev)

Tools:
I know some LISP (need to brush up), but I'm willing to pick up some books on .NET or other languages if it's warranted.

Opie
2012-01-04, 04:38 AM
I have done something similar using AutoLISP. My setup was to open the master drawing (the one with all the information) and execute a routine. This would propogate some variables to all open and subsequently opened drawings during the current session.

With the variables now available to all of the individual sheets, a second routine would complete the specific annotation.

BlackBox
2012-01-04, 05:31 AM
We use Sheet Set Manager (SSM) for this.

Specifically, we use attributed title blocks populated with Fields that reference Custom SSM Properties, so that if/when the client changes, etc. we literally change the applicable custom property once in SSM, and done. Simply publish, and all sheets have been automagically updated.

Our typical projects are 50-500 sheets.

Opie
2012-01-04, 03:04 PM
We use Sheet Set Manager (SSM) for this.

Specifically, we use attributed title blocks populated with Fields that reference Custom SSM Properties, so that if/when the client changes, etc. we literally change the applicable custom property once in SSM, and done. Simply publish, and all sheets have been automagically updated.

Our typical projects are 50-500 sheets.
Unfortunately, the SSM will not easily be able to tell a sheet via fields that it is affected with revisions 1 and 3 but not revision 2.

BlackBox
2012-01-04, 03:44 PM
Unfortunately, the SSM will not easily be able to tell a sheet via fields that it is affected with revisions 1 and 3 but not revision 2.

Agreed.

That is where a custom 'revision application' that tracks which sheets belong to which revision (per project) comes into necessity... One of the many things on my 'to-code' list.

Edit - In the mean time, we simply document this information on the key sheet, and manually navigate/edit.

Opie
2012-01-04, 04:38 PM
Agreed.

That is where a custom 'revision application' that tracks which sheets belong to which revision (per project) comes into necessity... One of the many things on my 'to-code' list.

Edit - In the mean time, we simply document this information on the key sheet, and manually navigate/edit.
What are your thoughts on implementing such an application?


Would you use .NET or AutoLISP?
Would this be database driven?
Would it be an automated application?

BlackBox
2012-01-04, 06:01 PM
What are your thoughts on implementing such an application?


Would you use .NET or AutoLISP?
Would this be database driven?
Would it be an automated application?



Great questions, Opie. :beer:

Mind you I've not even begun this project formally - That said - my initial intent is to incorporate a Windows Presentation Foundation (http://lmgtfy.com/?q=What+is+Windows+Presentation+Foundation%3F) (WPF) User Control into an AutoCAD Tool Palette, that will support:


An XML driven project revision 'database' (.REV?), that can track each sheet associated with a given revision, and the comment populated for each sheet's attribute within the contained titleblock (attribute must be unique)

Pseudo code:


<configuration>
<!--Do somethingg here,
like application version, etc.?-->
<project>
<projectInfo
createdBy="userName"
createdDate="MM/DD/YY"
lastModifiedBy="userName"
lastModifiedDate="MM/DD/YY"
projectNumber="1234567890"
projectPath="driveLetter:\filepath\"/>
<revisions>
<revision>
<revisionInfo
authorName="userName"
revisionDate="MM/DD/YY"
revisionName="Alpha or Numeric value here"/>
<sheets>
<sheet>
<drawing fileName="fileName01.dwg"/>
<filePath filePath="driveLetter:\filepath\"/>
<layouts>
<layout
attribute="Unique attribute tag within titleblock here"
comment="This is the comment that will show in the title block"
layoutName="LayoutName"
titleBlock="TitleBLock EffectiveName, etc."/>
<!-- Additional layouts here -->
</layouts>
</sheet>
<!-- Additional sheets here -->
</sheets>
</revision>
<!-- Additional revisions here -->
</revisions>
</project>
</configuration>
Edit to add - This configuration may need to be modified to support both single sheet drawings, as well as multi-sheet drawings (i.e., multiple layout tabs)

Edit to add - Pseudo code updated.


Functionality similar to SSM in that both multiple 'project revision' files can be opened manually, or the 'project revision' can be configured to open automagically upon opening any drawing in a directory where a 'project revision' file also exists (which will require an environment variable, or registry key).

That's as far as I've gotten conceptually (so far).

Opie
2012-01-04, 06:17 PM
I figured you would have something up your sleeve. ;)

BlackBox
2012-01-04, 06:26 PM
I figured you would have something up your sleeve. ;)

Edit - Thanks, and cheers, Opie! :beer:

The best part IMO - is that I just made up the majority of that post as prompted by your questions! http://www.cadtutor.net/forum/images/smilies/geek.gif http://www.cadtutor.net/forum/images/smilies/rofl.gif

BTW - Pseudo code updated for single, and multiple layout support.