by Dennis Collin
In the latest post about making blocks ‘smarter’ I am going to cover the topic of Lookup tables. Using lookup tables takes AutoCAD’s Dynamic Blocks to the next level, utilising a drop-down list to select several other dynamic block properties such as rotational, linear or visibility parameter properties.
This can be useful in an environment where blocks represent mechanical or electrical equipment or furniture where many parameters vary, where it is easier to select the variation of components from a simple list. Whilst dynamic blocks provide the ability to stretch and change a symbols appearance, there is a risk that an element might be stretched to an illegal or unavailable size, therefore Look-up tables provide a facility to restrict the dynamic block to settings that adhere to a typical manufacturers catalogue.
Fig 1. Desk Example Block in Editor with Linear and Visibility parameters configured.
In this example I have created a Dynamic Block featuring a desk with several different size options using Linear Parameters and a Stretch Action. The linear parameter has been set to a list format with some typical size values. There is also a visibility option used to control the presence of a cable tidy hole in the desk, which is just a typical yes/no option.
Fig 2. Defining standard sizes to later assign to lookup table.
I have previously covered using linear parameters and the stretching of blocks here:
Fig 3. Defining Visibility states which will be later accessed by the Lookup table.
Dynamic block visibility states are covered here:
By using Look-up tables, it is possible to control all these parameters via one single drop-down list which is what will be documented next.
Once a Dynamic Block has been assigned some length, width and visibility settings, it is now time to add a lookup parameter which will control these three settings. This can be access by the Block editor tool authoring palette, under the parameters tab.
Fig 4. Defining Lookup parameter and actions from AutoCAD’s authoring palette.
Click to place the Lookup location grip to one side of the block. We then need to assign a lookup action, and then specify which parameters are going to be assigned to the lookup table control.
Fig 5. Assigning lookup names to a range of parameter values.
Click add properties, select the required parameter names and for each configuration assign a ‘type’ name in the type properties section.
Once complete, click OK to return to the block editor.
Fig 6. A dynamic block with several dynamic block controls. Only the lookup control is required!
To avoid any conflicts or people accessing the wrong controls, hide any superfluous grips by selecting them and choosing hide grip on the context menu.
Fig 7. Turning off the redundant controls.
Once complete, the block should look simpler with only the relevant controls showing!
Fig 8. The completed block, ready for testing!
Exit the block editor and save changes. When placing or editing a block, a controlled list of size and display options can be selected from our simple look-up list!
Fig 9. Dynamic Blocks and Look-up tables feature on our more advanced AutoCAD courses!
Like any block this element can be stored in a block library drawing and accessed either from AutoCAD’s Designcentre or tool palette environments. It is also worth noting that Lookup tables and the other dynamic block properties are in AutoCAD LT too, although geometry constraints are only found in full AutoCAD. I will discuss those in a future post soon.
Creating and managing dynamic blocks is just one of several topics that we cover on the 2-day AutoCAD Intermediate Course. However, we also do focused days just on dynamic blocks. Visit https://training.cadline.co.uk where we will be happy to help.
Hozzászólások (0 hozzászólás)