AutoCAD Articulated Arithmetic: Getting a 'Maximum' Out of Fields

pic17.png

I’m tenacious, petty and I don’t like being told I can’t do things. This is the mindset of a madman, though this mindset has seen me through to great solutions to problems, well, sometimes. That said the solutions are not always practical (but I still work toward the solution because I'm right! … I told you I was petty), but in this madman's CAD lab I created and 'No-Code' smart title block!

 

 

I once encountered a request to have a 'No-Code' title block that would automatically show the current revision of a drawing based on the latest revision in the title blocks revisions list. Everywhere I looked, is seemed as if the answer was "No," but I found a way to achieve this, though it’s ultimately impractical.

 

CADnoob AutoTitle Block.gif

 

Before we get into the details of the Rube Goldberg-ESC solution I concocted, I want to say there are many ways to solve the problem of automating elements of title blocks. One way to automate things that often gets overlooked is the tools in the Sheet Set Manager. There are also many lisps and plugins available with a little forums/internet searching. If you are needing an automatic title block revision tools, those places are where you should be looking. Having said that, the parameters of the question I encountered precluded the use of these tools.


Now, on to the fun stuff: What was needed is a title block who's main revision reflected the latest revision number from the revision log. I thought that fields may offer the best path forward on this problem given the conditions of the request. I personally love the opportunities that fields in AutoCAD offer. I am always looking for new and interesting uses for fields in my DWGs. Check out this link for some of the great information already available for use with fields. My particular problem does not have a ready solution available in the functions of fields in out-of-the-box AutoCAD (if I am wrong in this, please leave a comment as I'm always looking for new insights!). There is no way to automatically pull the highest number from a revision log and put it in the main revision location in a title block.

 

Fields, however, do let one use mathematical formulas. It's at this juncture that I pull from some of my experience with the world of mathematics. I have a strong background (more properly intense loathing from prolonged exposure) in mathematics and I remembered that there was a mathematical formula that would give you a maximum number given two numbers. The maximum formula :

 

TheCADnoob_0-1670543487952.png

 

So I knew a solution could be possible... it would just take some nesting and tenacity and the drive to chase an impractical solution to its bitter end... as well as a quixotic madman to see it through. 

 

The first hurdle is; A maximum of two numbers will not suffice for most title blocks. They often include several revisions beyond a mere two revisions. So this is where we begin the journey into recursions and/or nesting. If we set up the title block revision field like an elimination bracket, we can see how we can systematically reduce the number of inputs down to two by pluging in our formula results into the next layer of formulas. We do this until we reduce the number of inputs to two... and it's a bit of a nightmare really. See image below for the text of the formula.

 

 

TheCADnoob_0-1670543201425.png

 

A key ability of fields that allows us to achieve this is that you can nest a field inside another field. You must first insert a field in what ever text element you will be using.  In that field select formula from the options. Then in the formula area, right click and select insert field.  This is how you can nest fields. An example of what that could like like is below. 

 

CADnoob Nested Fields.gif

So to achieve my goal, one simply need to plug in the monster formula from above in the formula field of the title block. Then in the places of R#, you need to insert a  nested field and then select the object options. There you can select the block and the corresponding revision attribute. The setup is quite arduous but the payoff of watching it work was worth it for me (at least this is what I tell my self).

 

CADnoob nested formula field.jpg

 

Once this is done, simply place the values in your revision block and use the REGEN command to update you title block revision. And there you have it, a 'No-Code' automatic revision title block. 

 

CADnoob AutoTitle Block.gif

 

Now with all that success behind us, it's time to face the fact that this in its current format is impractical for a couple reasons.

1. - Troubleshooting this algebraic mess will have you willing to pull out your wallet and buy any solution that doesn't require that much thought. 

2. - The fatal blow to this 'solution' is that you have to feed the formula a numeric value otherwise it will return ####. In other words ALL revision fields must have some numerical value only. Alpha numeric is not an option. 

3. - Trusting that this formula will survive the acid test of the horrible things that our young drafter do to drawings is a fools errand. 

 

 

I didn't share this to give the world a low-tech/non-functional Automatic Title block, but instead, I hope it might spark some curiosity into one of my favorite features in AutoCAD: AutoCAD Fields. I think there is a world of untapped potential in fields so I hope to inspire some creativity and gumption for everyone to start trying new unique things in their AutoCAD fields.  

5 Comments