Function CalcSurfaceArea calculates the surface area of the referenced solid object. The function supports only valid solids objects.
FUNCTION CalcSurfaceArea(solidObject : HANDLE): REAL;def vs.CalcSurfaceArea(solidObject):
return REAL| Name | Type | Description |
|---|---|---|
| solidObject | HANDLE | Handle to solids object. |
Calculates the volume of the given object if a valid solid.
PROCEDURE Example;
VAR
volume, area: REAL;
BEGIN
IF FSActLayer <> NIL THEN BEGIN
volume := CalcVolume(FSActLayer);
area := CalcSurfaceArea(FSActLayer);
Message('Volume ', volume, ', surface area ', area);
END;
END;
RUN(Example);def Example():
if vs.FSActLayer() != None:
volume = vs.CalcVolume(vs.FSActLayer())
area = vs.CalcSurfaceArea(vs.FSActLayer())
vs.Message('Volume ', volume, ', surface area ', area)
Example() ELSE BEGIN
{* Get the volume and surface area *}
gVolume := CalcVolume (gObjH);
gSurfArea := CalcSurfaceArea (gObjH);
{
message (' gVolume = ',gVolume ,' gSurfArea = ',gSurfArea ,' ObjVolume = ', ObjVolume (gObjH),' ObjSurfaceArea = ',ObjSurfaceArea (gObjH));
}
{* If the surface area is non-zero, get the remaining properties and display the dialog *}import vs
# Function CalcSurfaceArea calculates the surface area of the referenced
# solid object.
solidObject = vs.FSActLayer() # handle to the first selected object on the active layer
area = vs.CalcSurfaceArea(solidObject)
vs.Message('CalcSurfaceArea returned: ' + str(area))CalcSurfaceArea is obsolete as of VectorWorks12.5
Availability: from VectorWorks8.0