May 27, 2013

ACA: Imperial MVB in Metric Drawing

There have been a few reports of misbehaving Multi-View Blocks [MVB] in the AutoCAD® Architecture Discussion Group recently. Specifically, the issue was that when Imperial-unit content was inserted into a Metric-unit drawing, the 3D or model view block came in incorrectly, with parts scrambled. I looked into one specific instance of this, the "Side-Side" refrigerator content, which inserts a MVB called I_Appl_Refrig_Side-Side, and have discovered what is happening.

In the image above, on the left side you can see an instance of the model view block, I_APPL_REFRIG_SIDE-SIDE_M, inserted into a drawing where the length unit is inches along with a blue "X" indicating the insertion point at the middle of the bottom back edge. This shows the model block as it is intended to be seen. On the right side of the image is the same model view block inserted into a drawing where the length unit is millimeters. In addition to the blue "X" at the insertion point, there is also an instance of the top/bottom view block placed at the same insertion point, in red.

When the Imperial content was inserted into the Metric drawing, ACA applied a scale factor of 25.4 to account for the difference in length between inches and millimeters. This worked as expected for the view blocks assigned to the orthogonal directions (top, bottom, front, back, left and right), where there were no nested blocks of any kind. In the model block, however, while the door handles are drawn "directly" using 3D Faces and Polygon Meshes, the main refrigerator body and the two doors are instances of a unit block called 3DBLOCK, which is a cube composed of six 3D Faces, each one unit on a side. This block is defined as being unitless, but ACA appears to consider it as being inch-based due to its being nested within inch-based content. The insertion point of this unit block is at one corner, with the cube extending along the positive X-, Y- and Z-axes.

In the model view block, these instances have X-, Y- and Z-scale factors applied so that each instance is the proper size for the part it represents, and the insertion point are offset from the insertion point of the view block to get the parts in the desired location. When the MVB is inserted into a millimeter-based file, the scale factor of 25.4 gets applied to the door handles, which are resized relative to the model block insertion point correctly. But the same is not true for the unit blocks. The 3DBLOCK unit block itself is redefined, such that the sides of the cube are now 25.4 units long. The instances of the 3DBLOCK are not scaled at all, however. This results in the pieces being the correct size, since the unit block definition was scaled up, but their insertion points remain at the same numeric distance from the model view block insertion point, when that distance should be 25.4 times greater. This results in the incorrect placement seen on the right side of the image above.

I redefined the view blocks in ACA 2014 to create a "proper" millimeter-based content file (which cannot be inserted into an inch-based file). You can download copies of my revised files, and also read what I did in more detail, in the Blocks corrupted thread in the Autodesk AutoCAD Architecture Discussion Group.