PrimeTimeAction Posted December 13, 2019 Share Posted December 13, 2019 I have a solid profile extruded to different heights in the model space. Is there a way to extract the heights of these solids in the form of list or excel, similar to using data extraction? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted December 14, 2019 Share Posted December 14, 2019 (vlax-dump-object solid t) there's no related extrusion property. just $0.02 i might be wrong, vla-get-volume divided by area = height maybe temporary explode, compare the lowest & higher contour elevations? after getting data then undo? Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted December 15, 2019 Share Posted December 15, 2019 If the top and bottom faces of a solid are parallel to the XY plane of the WCS you can used its boundingbox to calculate its height. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 15, 2019 Share Posted December 15, 2019 : MASSPROP Select entities: Entities in set: 1 Select entities: ---------------- SOLIDS ---------------- Mass: 24449.8172 Volume: 24449.8172 Bounding Box: Lower Bound: X= -57.4763 Y= 43.5237 Z= 0.0000 Upper Bound: X= -32.5237 Y= 68.4763 Z= 50.0000 Centroid: X= -44.9999 Y= 56.0000 Z= 25.0000 Quote Link to comment Share on other sites More sharing options...
Stefan BMR Posted December 15, 2019 Share Posted December 15, 2019 If the solids are made using extrude command, with a height, not path, then you can extract the height like this: (defun c:test ( / e solid) (while (and (setq e (car (entsel))) (setq e (cdr (assoc 350 (entget e)))) (eq (cdr (assoc 0 (setq e (entget e)))) "ACSH_HISTORY_CLASS") (setq e (cdr (assoc 360 e))) (eq (cdr (assoc 0 (setq e (entget e)))) "ACAD_EVALUATION_GRAPH") (setq e (cdr (assoc 360 e))) (setq e (entget e)) (setq solid (cdr (assoc 0 e))) ) (cond ((eq solid "ACSH_EXTRUSION_CLASS") (princ (strcat "\nExtrusion Height: " (rtos (distance '(0 0 0) (cdr (assoc 10 e)))))) ) ((eq solid "ACSH_BOX_CLASS") (princ (strcat "\nBox Height: " (rtos (cdr (assoc 42 (reverse e)))))) ) ((eq solid "ACSH_CYLINDER_CLASS") (princ (strcat "\nCylinder Height: " (rtos (cdr (assoc 40 (reverse e)))))) ) (T (princ "\nUnable to extract solid height.") ) ) ) (princ) ) Doesn't work on edited solids, or modified by a boolean operation. Still, if the section of the solid (section perpendicular to extrusion direction) is a circle or a rectangle, you can find the height with some calculation over the geometric properties. 2 Quote Link to comment Share on other sites More sharing options...
CetmeOnFire Posted October 18, 2023 Share Posted October 18, 2023 Thanks to Lee Mac, just what I needed for a sub routine for 3D Bolts and subtracting the cylindrical holes from the 3D Objects selected. - Red in Oklahoma Quote Link to comment Share on other sites More sharing options...
pkenewell Posted October 19, 2023 Share Posted October 19, 2023 22 hours ago, CetmeOnFire said: Thanks to Lee Mac, just what I needed for a sub routine for 3D Bolts and subtracting the cylindrical holes from the 3D Objects selected. - Red in Oklahoma @CetmeOnFire And what was that? What code did Mr. Lee Mac provide? Just Curious... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.