TJL Posted February 25, 2003 Share Posted February 25, 2003 I often need to know the volume of a solid, ex. for casting price calculation. I must admit I have now experience in using the Worksheet and in that connection how to use the = Volume(t = solidcsg) criteria to calculate a volume of a chosen solid object. Can any one give me hints to how to perform this calculations. At the same time I would suggest that the volume value should be showen in the object info pallet, together with area of 3D surfaces. Torben Juul Laursen Denmark tjl@post10.tele.dk Quote Link to comment
Vectorworks, Inc Employee Andrew Bell@NV Posted February 25, 2003 Vectorworks, Inc Employee Share Posted February 25, 2003 quote: Originally posted by TJL: Can any one give me hints to how to perform this calculations. There are VectorScript functions that will display volume and surface area. Procedure MyVolInfo; BEGIN IF FSActlayer <> nil THEN BEGIN Message('Volume ',CalcVolume(FSActlayer), ', surface area ', CalcSurfaceArea(FSActlayer)); END ELSE Message('No object selected.'); END; Run(MyVolInfo); quote: At the same time I would suggest that the volume value should be showen in the object info pallet, together with area of 3D surfaces. The reason it isn't done is so VectorWorks isn't sluggish. For a complex solid, computing the volume and surface area can take enough time that it would affect the responsiveness of the system. A slightly more complex VectorScript that computes the volume and surface area of multiple selected solids is: Procedure MyVolInfo; VAR myHandle:HANDLE; volume, area: REAL; BEGIN IF FSActlayer <> nil THEN BEGIN myHandle := FSActLayer; volume := 0; area := 0; while myHandle <> nil DO BEGIN volume := volume + CalcVolume(myHandle); area := area + CalcSurfaceArea(myHandle); myHandle := NextSObj(myHandle); END;{while} Message('Volume ',volume, ', surface area ', area); END ELSE Message('No object selected.'); END; Run(MyVolInfo); Quote Link to comment
Cloud Hidden Posted February 27, 2003 Share Posted February 27, 2003 Thanks for posting the script. Coincidentally I had a big need for that very thing just this evening. It's a big help. Jim Quote Link to comment
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.