CabMasterPro User Guide
In This Topic
    Wall and PolyItem Edges : Developer
    In This Topic

    There are middleware lookups available for properties of a wall edge, and similarly for properties of a polyitem edge. These let you lookup and in some cases change these properties directly from middleware. See Walls Tool for a discussion of these properties.

    The currently selected edge can be obtained using the variable ‘EdgeIndex’. The number of edges can be obtained by looking up the variable 'NumberOfEdges'. For example you can loop through the edges with a for loop like this, using or setting the properties of each wallitem or polyitem edge…

     

    Properties per Edge

    array [i] syntax

    These properties per edge can be referenced via array [i] syntax.

    Length[i] The length of edge #i - E.g. 1000mm. This is the same as using the Distance formula to calculate Distance(Point[i], Point[i+1])
    Radius[i] The radius of edge #i or zero if edge is not curved.
    ArcLength[i] The length of edge #i measured along the curved arc. This will be the same as Length[i] if the edge is not curved.
    Angle[i] The angle direction of edge #i joining the start to end vertices. This is the same as the angle used in the wall tool to draw a draw edge. That is, 0 = left to right along x-axis, 90 = up along y-axis etc.
    Point[i] This is the xy-position of the start point of edge #i - E.g. Point2D(2000mm,4000mm)
    PointX[i] For Point[i], this just extracts the x-coordinate - E.g. 2000mm in above example.
    PointY[i] For Point[i], this just extracts the y-coordinate - E.g. 4000mm in above example.
    EdgeMidPoint[i]

    This is the xy position of the midpoint of edge #i

    E.g. If Point[1] is Point2D(2000mm,4000mm) and Point[2] is Point2D(3000mm,4000mm)

    then EdgeMidPoint[1] would be Point2D(2500mm,4000mm)

    This is the same as MidPoint(Point[i], Point[i+1])

    EdgeMidPointX[i] For EdgeMidPoint[i], this just extracts the x-coordinate - E.g. 2500mm in above example.
    EdgeMidPointY[i] For EdgeMidPoint[i], this just extracts the y-coordinate - E.g. 4000mm in above example.

    edge[i].prop syntax

    The 'Edge of Wall' drop list is not formula controlled but sets up the context for the other formuals on the page to evaluate it. Or from middleware, you can lookup the currently selected edge using the variable ‘EdgeIndex’.

    Some properties of each wall edge are able to be controlled or set using syntax like edge[1].top and edge[1].oneway, etc.

    Here is a list of those properties per edge that can be referenced via edge[i].prop syntax.

    Aggregate Properties

    TotalLength To get the sum of the lengths of all wall edges use the variable TotalLength which returns the sum of the lengths of all the segments.
    NumberOfEdges the number of edges for this wall or polyitem.
    NumberOfVertices the number of vertices (edge start or endpoints) for this wall or polyitem, which is always one more than the NumberOfEdges.

    Example



    See Also