Here is a routine that employs some of the concepts described in these threads:
http://www.theswamp.org/index.php?topic=16754.0http://www.theswamp.org/index.php?topic=20389.0This routine does a reasonably good job measuring the lengths of arbitrarily aligned extruded solids. An original orientation via PrincipalDirection is refined with the generation of parallel section (virtual CAT scan) and centroid comparison. This refinement is useful when querying extrusions with additional Booleans and/or slices -particularly at the ends.
There is also an attempt at Section recognition included within the routine. If a library of Sections is pre-processed, the main routine will compare a 3D Solid section to this library and hopefully find a match.
The attached DWG includes some tagged sections (XData) and solids based on those sections. To include a new section (as a Region entity), run the SetRegData routine.
This routine makes a few assumptions about the solid (specifically in the Reorient and GenSection subs). Unfortunately, there seems to be a direct relationship between high confidence and time of execution. The current level is a good trade off for my style of CAD work, though may be insufficient for more exacting design issues.
Any suggestions to modify, eliminate, or reduce the quantity of these assumptions would be greatly appreciated.
Note: Code requires a reference to the appropriate Autocad/ObjectDBX library via VBAIDE-Tools-References