[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.
Automatic Updating Scale Bar
Tip# 3185 By Gary Evenson On 19-Apr-2009
4
Rated By 2 users Downloaded : 3396
Categories : Link Table Data
Software type : AutoCAD 2009
Rename File To : ViewportScale.dwg
Use tables and fields to create a scale bar that will automatically update its scale when the corresponding viewport changes its scale.

Gary Evenson sent us a file that uses tables and fields to create a scale bar that will automatically update its scale when the corresponding viewport changes its scale.

"I created a scale bar (static linework) with a table for the values. The values for the scale divisions are automatically created from a formula in the table. For example, if I set the scale to 1:1000 (1: and 1000 are two separate cells but justified to look as one), it calculates the value for the scale divisions and displays the correct number in the cell.

"I have recently taken this one step further by adding another value in an empty cell (color set to 255 so it does not print) -- this value is a field that returns the value of Objects/Viewport/Custom scale, now my value from above (1000) is replaced with another formula that calculates the scale based on the viewport custom scale value and presents in back in the format I require. Now when the viewport scale is changed a regen updates my scalebar.

"There are a couple items of note when working with these scale bars -- if the viewport and scale bar are copied, the field is still linked to the original viewport, same thing if the layout is copied, the field in the table refers to the viewport in the previous layout. This is easily remedied by editing the field and selecting the viewport in the current layout or the needed viewport if you have multiple viewports in a single layout."

NOTES FROM CADALYST TIP PATROL: This is a great use of fields and tables to display information on a drawing that may change throughout the life of the file. The tipster created a table that has a cell getting the scale of a viewport (this is great because you can use this table in a file with multiple viewports that have different scales) and then display that information accordingly. There are formulas in the other cells to display the scale appropriately. To apply the scale bar to your drawings, open the attached file with this tip, copy the table, and paste it into your drawing. The table is set to be in meters, change the text to the proper units. That cell is nothing more than text, so it is an easy change. In Cell F1, edit the field so that it is getting the scale from the viewport you want it to. That's it. You may want to edit the formatting of the table to suit your needs, but it is rather simple to use and update for a specific viewport. I like this tip.

 

Average Rating:
4


User comments
Comment by vger,dj
Posted on 2009-04-21 16:24:17
this got me started on making a similar scale for engineering
Comment by Bratko,Joanna
Posted on 2009-04-22 00:43:58
Great Tip. I have updated our standard scale based on your example. Great time saver and safety for drafting.
Comment by vger,dj
Posted on 2009-04-22 11:10:56
update and fix for scale_vp
Comment by Hernandez,Henry
Posted on 2009-04-22 12:43:53
This works okay if working in a ctb format where you can force a no plot color to the viewport scale factor in its cell but since we plot using a stb format that is not possible unless I am missing something. The table cells are on the same layer and forcing a color does not have a screen of 0.
Comment by Hernandez,Henry
Posted on 2009-04-22 12:48:07
This work fine when using a ctb format where you can force a no plot color to the viewport scale factor. But what if you plot using a stb format?