Jump to content

Solid volumen calculation


TJL

Recommended Posts

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 [Frown]

Link to comment
  • Vectorworks, Inc Employee

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);

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...