A CurveVector
is an in-memory abstraction
of one or more DGN linear elements.
Here's what the MicroStationAPI help documentation tells us about it …
A CurveVector is a collection of curve primitives.
The collection has a type code that indicates whether it acts as an open chain, single loop (inner or outer), or a parent of multiple loops.
This can represent paths, loops, multiloop parity regions, and multi-region collections.
CurveVector::BOUNDARY_TYPE_OPEN prim1 prim2 ... primN
)
CurveVector::BOUNDARY_TYPE_OUTER prim1 prim2 ... primN
)
(CurveVector::BOUNDARY_TYPE_UNION_REGION (CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN) (CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN) (CurveVector::BOUNDARY_TYPE_INNER prim1 ... primN) )
(CurveVector::BOUNDARY_TYPE_UNION_REGION // the direct children of this CurveVector may be any set of Outer and ParityRegion
(CurveVector:ParityRegion
(CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN)
(CurveVector::BOUNDARY_TYPE_OUTER prim1 ... primN)
(CurveVector::BOUNDARY_TYPE_INNER prim1 ... primN)
)
(CurveVector::BOUNDARY_TYPE_OUTER prim1 prim2 ... primN)
)
A parity region is a collection of unordered loops. A point moving in the plane transitions from "in" to "out" (or vice versa) any time it crosses a curve.
This definition of inside and outside is well defined even if (a) the loops cross each other, (b) self-intersection within a loop, (c) any order of presentation of the loops.
In the usual case where there is a single outer loop and one or more hole loops, it is customary to store the outer loop first followed by holes, with the outer loop counterclockwise and inner loops clockwise.
Warning: Computational code that requires signed loops (e.g. area calculations) assumes that the largest loop is outer and others are inner.
One way to use the CurveVector
class to handle a single DGN primitive (e.g. a LineElement) is …
CurveVector
CurveVector
CurveVector
to a DGN element
Expressing the above in code …
EditElementHandle eeh = # get an element cv: MSPyBentleyGeom.CurveVector = ICurvePathQuery.ElementToCurveVector(eeh) # do something with CurveVector … # create a new element from the modified CurveVector DraftingElementSchema.ToElement(eeh, cv)
Post questions about MicroStation Python programming to the MicroStation Programming Forum.