VS:GetLayerElevation

From Vectorworks Developer
Revision as of 14:32, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Gets the elevation and thickness of the specified layer.

PROCEDURE GetLayerElevation(
h :HANDLE;
VAR baseElev :REAL;
VAR thickness :REAL);
def vs.GetLayerElevation(h):
    return (baseElev, thickness)

Parameters

h HANDLE Handle to the layer
baseElev REAL Base elevation of the layer
thickness REAL Thickness of the layer

Remarks

orso 2006.11.25: Please note that this routines always returns millimeters.

Example

VectorScript

PROCEDURE Example;
VAR
    h :HANDLE; 
    baseElev, thickness :REAL;
BEGIN
    h := FLayer;
    WHILE h <> NIL DO BEGIN
        GetLayerElevation(h, baseElev, thickness);
        thickness := thickness / (25.4 / GetPrefReal(152)); { convert from mm to current units }
        AlrtDialog(Concat('layer name: ', GetLName(h), ', baseElev: ', baseElev, ', thickness: ', thickness));
        h := NextLayer(h);
    END;
END;
RUN(Example);

Python

def Example():
    h = vs.FLayer()
    while h != None:
        baseElev, thickness = vs.GetLayerElevation(h)
        thickness = thickness / (25.4 / vs.GetPrefReal(152)) #{ convert from mm to current units }
        vs.AlrtDialog(vs.Concat('layer name: ', vs.GetLName(h), ', baseElev: ', baseElev, ', thickness: ', thickness))
        h = vs.NextLayer(h)
Example()

Version

Availability: from VectorWorks10.0

See Also

VS Functions:

VS:SetLayerElevation

VS Functions: [[VS:SetLayerElevation]]