Scale those AutoCAD Objects Based on Data Attached

Do you need to display some of your objects (blocks or points) based on the Object Data or database link values assigned to them? You know you can always do the attach the drawing and perform an alter-properties query on it method, but there is another way that may be shorter and easier if you do not like doing those queries.

By using the Display Manager, creating a new map, then set up a style using symbols, this method works with out using the FDO or data connect so you can use it on standard AutoCAD entities. Here is an example using simple a simple block called Existing_Hyd with OD attached.


Notice the OD field named PSI, that’s the field that we will use to scale the blocks. The values in my drawing for this field are 1000, 1500, 2000, & 2500. This is the water pressure at each of the hydrants in my map.

The first thing we do is create a new Map in the display manager (a map not a new dwg).


Click on the Data Icon and select New Map. Then change the name from New Map 1 to what ever you want. Next we add our drawing objects to this map.


Click the Data icon again and select “Add Drawing Data” then Drawing Layers. Select the layer the blocks or points are on.


It helps if the blocks or points you need to scale are on their own layer.

The blocks will now display in the map along with a map layer displayed in the display manager, but we need to set up a style. Right click on the new map layer and select “Add Style” “Symbol”


We now have a new element in the display manager named “Symbol style” and the blocks in the map took on a new look. This is normal and uses the default symbol of a square with an X in the middle of it as the symbol for the blocks.


To change this back to our block we right click on the “element” (Symbol Style) and go to the properties palette to make a few edits.


First rename the Style Name to reflect what the style is for, and then under the “Style Traits” select the block to use for the symbol. Note if you are using points and you want to use a block for the symbol the blocks must in defined in the current drawing.

The next item to edit is the “Scale” property for the symbol.


Use the Expression Chooser to select the Object Data field that you want to use to scale the blocks by.

Now the problem might be that the OD value is to way to large to use as a scale factor. Take my sample for instance. I want to use the PSI values to use, but those vales are up in the thousands, which makes the blocks WAY TOO BIG for my map. This is where the old legacy map shines verses the FDO ways and expression used there. With this method I can use a lisp expression to change the scale values right here in the property palette. The lisp expression I used is an arithmetic function that divides the OD value by 100 or by any number you desire.


There is a number of arithmetic functions listed in the help files under the expression evaluator that you can use if there you need to scale, rotate, or assign lineweight for the objects based on the data attached to objects just remember to include the opening and closing parentheses ( ) in the property value.



Readers Locations

Top Rated posts

Chat room

%d bloggers like this: