Block Metric
Plugin AVC_Assembly for AutoCAD and BricsCAD
Calculation of the dimensions of the block, the sum of the lengths of all curves, the area and volume of the solids, the weight and price of parts. Writing results to block attributes. Creation of any attributes in 1 click.
The BlockMetric command can help automate the extraction of useful information about a drawing. The program will calculate the dimensions and total parameters of all objects inside the block and write the received data into the attributes of this block. After processing the drawing with this command, you can extract data from the attributes of the blocks and draw up statements of line lengths, estimates and tables with the volume, weight and cost of all assembly blocks. Writing results to ordinary block attributes allows you to use any standard and non-standard methods of data extraction, database connections. You will be able to use your assembly blocks in external information systems, including BIM.
The program closely interacts with the A>V>C> Properties Palette in which you can not only see the results of block measurements, but also correct them. For example, you can fix the weight and price of some nested blocks (purchased items) and the BlockMetric program will take this data into account and not try to change it.
Features of the program
The program creates and populates the following attributes:
Size X, Size Y, Size Z - dimensions of the box into which all block objects fit. It is measured along the three axes of the block's internal coordinate system, regardless of how the block reference is inserted or rotated. But if the reference is inserted with scaling, then the dimensions are multiplied by the scale factor. Measured in the current drawing units. When written to an attribute, it is cast to the string as configured for length formatting in Common Options.
Perimeter - the total length of all lines and curves; plus the perimeter of all enclosed shapes, regions and surfaces; plus the perimeter of the front surfaces of the 3d solids (i.e. the length of the cut). In a millimeter drawing, the perimeter is converted to meters.
Area - the total area of polylines and curves (AutoCAD can somehow calculate even the area of non-closed curves); plus the area of regions, surfaces and meshes; plus the area of the front surfaces of 3d solids (that is, the net area of the sheet material, without holes). If sheet material is specified, the area will be multiplied by the safety factor. In a millimeter drawing, the area is converted to square meters.
Volume - the sum of volumes is calculated only for 3d solids. In a millimeter drawing - in cubic meters.
Weight - is calculated only for solids with a given material and only if the material has a given density. The units depend on your density units - the program will simply multiply the volume by this figure.
Cost - is calculated only for solids with a given material and only if the material has a price. The calculation depends on the type of material. The program will also calculate and add the price of all coatings and edge bandings. For scaled blocks, always gives zero.
Measure - a switch (Yes or No) to block the calculation of the metric. If there is a nested block for which measurement is prohibited, the program will add those metrics that were previously writed.
Any additional attributes can be added to the block. Just make a list of attribute names and their default values. Moreover, you can create both constant and mutable attributes. And the default values can contain block and drawing property substitutions.
The program works only with blocks, but takes into account any objects inside them, including nested blocks.
Works with dynamic blocks.
Works with scaled blocks: when substituted into the Data Table, the size, perimeter, area, volume and weight are recalculated correctly. But not the cost.
You can configure which drawing objects are taken into account, and which are filtered and ignored. The filter can be configured by object type, by layer, line type and so on. You can customize up to 9 filtering styles and quickly switch between them.
Manually entered values of block attributes can be protected from changes by unchecking the Measure checkbox in the block properties in the Properties Palette (Or assign the Measure attribute to No)
By default, the program assumes that all annotative blocks have the Measure attribute = No. And all metrics of these blocks will be considered zero. The same is true for blocks not marked as Explodable.
In a millimeter drawing (InsUnits = 4), the perimeter, area and volume will be converted to meters.
If there are no attributes in the block, then the program itself will create invisible constant attributes to store the results. You can make these attributes visible and move them to the desired location in the block - use the regular block editor (_bedit).
Block attribute names are customizable.
All results can be retrieved into the Data Table and referenced in Smart Leaders using attribute substitutions. And then, you can save them to tables in a drawing or in Excel.
Limitations of the program
The program does not work with distorted blocks whose scaling factors differ on different axes.
The program will not try to recalculate the cost of the scaled blocks.
To calculate the weight and cost of assemblies, you need to correctly set up material properties and assign materials to solids; coatings and edge bandings to solid surfaces. Or set the weight and price of the block manually. To do this, you need to use the A>V>C> Properties Palette.
The program does not take into account the weight of coatings and edge bandings. But it takes into account their price.
- The program has not been tested for compatibility with BricsCAD Mechanical assemblies and components.
All measurements are made with the block definition, not with block references. The results are also written to the block definition in constant attributes, which will be the same for all block references, regardless of scaling and rotation. Therefore, if you use block scaling, then do not extract data with the standard DataExtraction command.
For the same reason, you cannot enter different metrics on different instances of the same dynamic block.
Block size are always calculated in the block's internal coordinate system. Therefore, they may differ from the dimensions of the rotated block reference. Use the %Size X% substitution when you need the dimensions of the block itself. And the substitution %extentsx%, when you need the size of the rotated block reference in the world coordinate system.
The block metric will not update itself. If you have changed something inside the block, or created a new variant of the dynamic block, or reconfigured the prices of materials, you will need to call the BlockMetric command again.
To make full use of the scaled and distorted blocks, you can convert them to regular ones in 1 click using the New Assembly (AsmNew) command.
You can order the addition of any other calculations and attributes. The cost of the special version is 50 Euro for each additional attribute.
Regardless of the AutoCAD|BricsCAD localization language, you can switch the plugin to English, Russian, Italian, German, Chinese localization.
Read about downloading and installing the program here.
To run the plugin, you will have to register account and top up your account balance by making a donation or receiving bonuses.
Then you can activate one of the licenses:
Annual license - 10 ERU.
Unlimited license - 50 EUR. Free updates for 1 year.
The trial period is 20 days.
Working with the Block Metric command
Preparation
Create assembly blocks from 2d objects or from 3d solids. Materials and coatings can be assigned to solids. It is important to correctly set the type of material, its density and price. Then the program will be able to calculate the weight and cost of the product. Don't forget to set up stocks in Common Options as well. You can use the AsmCreate command to create blocks. Scaled and distorted blocks are best converted to regular blocks using the AsmNew command.
For some blocks, you can disable measurement. Open the Properties palette on the Block tab and uncheck the Measure box. Now all metric fields will become available to you and you will be able to write down the real values of weight and cost. This can be done with all purchased products, fasteners, fittings. Note that the metric (like all constant attributes) is editable only in the block properties, not in the block reference properties.
For all 2d blocks, you will also have to manually enter the metric parameters if you want to calculate their weight and cost.
You can first measure once, and then prohibit the measurement and correct the metric.
Launch
Call the BlockMetric command. If nothing is selected in the drawing, then the command will ask you to select blocks. The entire model can be selected (ALL option).
On the command line, you will see an option to switch the style and to invoke the customization dialog.
Next, the program will select the necessary objects in accordance with the configured filtering conditions. Among the remaining objects, only blocks will be selected and their measurement will begin.
The program will calculate the dimensions of all block objects, find the sum of lengths and perimeters, calculate the total area and volume. For all solids, the solid metric will be calculated and added to the block metric. If there is a nested block marked "Measure", then the measurement procedure will also be performed for it. And if measurement is prohibited, then the program will simply add its metric, as it was recorded in the attributes. If you write incomprehensible texts in the attributes, the program will consider this metric equal to 0.
The program will tell you why some objects were predicted, what filter they fell under.
The measurement results will be written to the attributes. Attribute names are set in the settings. If the block does not yet have such an attribute, it will be created and marked as constant and invisible.
In addition, all attributes from the Attributes and Constant Attributes lists will be created. If you have specified substitutions in attribute values, then the program will perform substitution of block and drawing properties for constant attributes and substitution of block reference properties for variable attributes. If the block already had such attributes, the program will not change their values.
If mutable attributes have been created, then the program will call the AttSync command and you will see these attributes for all references to the block.
At the end of the work, the program will write how many block definitions have been measured.
Watch the command line for error messages.
Configuring Block Metrics
The block metric settings can be found in the A>V>C> Options Palette. Or, invoke the TUNE option on the BlockMetric command during block selection.
In the settings header, you see a drop-down list for selecting a set of settings (style). The style number is used to quickly switch from the command line when prompted to select objects. There is a button for adding a new style next to the list. The new style is created by copying the current one. You can create up to 9 styles. Any style, except the 1st one, can be deleted.
Style name
The name of the preset. Not used anywhere. For convenience only.
Object selection filter
Determines which objects will be taken into account when calculating the block metric, and which will be ignored. Unlike other commands, the filter by object type only works within blocks. Do not forget to exclude the Holes layer so that the volume of the solid holes does not add to the volume of the blocks.
Attribute names (tags)
You can customize how each attribute added to the block is named. The same name should be used in substitutions (respecting the case of letters). The same name will be used in the block properties in the Properties Palette.
Spaces are allowed in attribute names, but some special characters are not allowed. All attribute names must be different.
Attribute names are independent of Metrica style.
After changing the attribute names, you will need to invoke the BlockMetric command again. In this case, the blocks will retain the old attributes with the old names, but they will no longer be updated. You can easily remove them using the Properties palette A> V> C>.
Attributes
A list of invisible mutable attributes that the program will add to all blocks and block references. Each attribute should be written on a new line. Use only characters allowed in object names in the attribute name. Illegal characters will be replaced with _. After the name, you can write the symbol equals = and then write the attribute's default value. You can use substitutions. The program will substitute the values of the block reference properties for all existing links in the entire drawing. But if you later insert new references to the block into the drawing, then the substitutions will not be implemented. If the block already contained attributes with the same name, then the attributes will retain their old values.
Constant attributes
List of invisible immutable attributes that the program will add to all blocks. Constant attributes are not shown in the regular property pane, but they can be extracted with the DataExtruction command. Each attribute should be written on a new line. Use only characters allowed in object names in the attribute name. Illegal characters will be replaced with _. After the name, you can write the symbol equals = and then write the attribute's default value. You can use block, drawing, current time property substitutions. But you can't use block reference properties here, such as layer, color, and the like. If the block already contained attributes with the same name, then the attributes will retain their old values.
There is also a separate setting for the Properties Palette A> V> C>, which enables or hides the metrics of the blocks in the palette. If the display of metrics is disabled, then you will see all metrics as regular constant attributes.