[Search tip detail and code files using keywords, tip number, author name, etc ]
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Use Formulas to Fill in a Scale Bar
Tip# 3912 By Alex D. Fry On 18-Jun-2012
Rated By 0 users Downloaded : 197
Categories : Edit Tables
Software type : AutoCAD 2013
This scale bar is available in three versions: km, m, and mm.

Alex D. Fry, a civil drafting technologist, sends an AutoCAD table tip that uses formulas to create a scale bar.

"Here is a screenshot of the scale bar that I designed for my company:

You can use formulas to fill in the numbers along your scale bar. The bottom left cell (A4) is color 255, so it doesn't display when plotted. Cells B2 to F2 are formulas based on multiples of cell A4. The scale title is just text, except for the number 250 000. I have inserted a field that references cell A4:

%<AcExpr (A4) f "%th32">%

"Because the company that I work for does a wide variety of drawings, from large-scale mapping like this to structural details down to the mm, we needed multiple scale bars. So I have three versions of this scale bar: km, m, and mm.

"My scale bar block cannot be changed after insertion. First you must select km, m, or mm from the available visibility states, and explode it; then you can edit the scale. I have also built in even more scale bars that we use when more than one scale appears on a drawing, but this version is the more complicated one and once you can do this, you can come up with the rest, no problem."

Notes from Cadalyst Tip Reviewer Brian Benton:
Setting up this block is simple enough, if you have used tables in AutoCAD or a spreadsheet before. Create your table, and enter your scale in the cell as described. For each cell that contains a length to scale, create a formula that reads the scale factor text and divides by the appropriate number. In the example given, the scale factor is 250 000. The first scale length is 2.5. Your formula for that scale (in an AutoCAD table) should be:

%<AcExpr (A4) f "%zs11%ct8[1e-005]%th32">%

(I know that doesn't make any sense, but AutoCAD understands it.)

Here is a simpler method: In cell A4, type in the number 250000. Click cell B2m once to activate the cell. Don't open the text editor. Right-click, and choose Insert and Field. In the Formula area, type in =A4 and click the Evaluate button. The preview at the top right should display the contents of cell A4. Click the Additional Format button. In the Conversion Factor area, type in the mathematical conversion needed to display 250000 as 2.5 (it should be 1/100000). Your preview should read 2.5. Keep doing this in each field until you have properly converted each scale factor.


Average Rating:

User comments
Comment by nemirovsky,len
Posted on 2012-06-19 14:36:49
Very nice, WORKS as deskribed......
Comment by Fry,Alex
Posted on 2012-07-11 14:03:04
In case the autocad field expression is too much for you, you can also type in basic formulas in a similar fashion to MS Excel. Instead of %<AcExpr (A4) f "%zs11%ct8[1e-005]%th32">% you can simply type =A4*0.00001

Log In