Entities
The elements of one drawing context: the model root, a group or a component definition. Iteration takes a snapshot. All edits must happen inside Model.operation.
Implements
Section titled “Implements”Iterable<AnyElement>
Properties
Section titled “Properties”length
Section titled “length”
readonlylength:number
Number of elements.
vertices
Section titled “vertices”
readonlyvertices: readonlyVertex[]
All vertices in this context.
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<AnyElement>
Returns
Section titled “Returns”Iterator<AnyElement>
Implementation of
Section titled “Implementation of”Iterable.[iterator]
addEdges()
Section titled “addEdges()”addEdges(
points):Edge[]
Draws connected line segments through two or more points. Segments split where they cross existing edges, and closing a planar outline can create a face. Returns the edges that now lie on the requested segments, in model order; there isn’t necessarily one edge per segment.
Parameters
Section titled “Parameters”points
Section titled “points”Iterable<Point3dLike>
Returns
Section titled “Returns”Edge[]
at(
index):AnyElement|undefined
Returns the element at index, counting from the end when negative.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”AnyElement | undefined
copyEntities()
Section titled “copyEntities()”copyEntities(
transformation,entities):AnyDrawingElement[]
Copies elements of this context, transformed, and returns the new elements. The originals don’t change. Face boundaries, complete curves and holes are copied too, groups and instances keep their definitions, and copies don’t merge with geometry they intersect.
Parameters
Section titled “Parameters”transformation
Section titled “transformation”entities
Section titled “entities”Iterable<DrawingElement>
Returns
Section titled “Returns”erase()
Section titled “erase()”erase(
entity):void
Erases one entity, subject to the model’s topology rules.
Parameters
Section titled “Parameters”entity
Section titled “entity”Returns
Section titled “Returns”void
eraseEdges()
Section titled “eraseEdges()”eraseEdges(
edges):void
Erases several edges at once and heals the faces around them. Erasing any edge of a curve erases the whole curve.
Parameters
Section titled “Parameters”Iterable<Edge>
Returns
Section titled “Returns”void
ofType()
Section titled “ofType()”ofType<
T>(type): (Extract<Guide, {type:T; }> |Extract<Edge, {type:T; }> |Extract<Face, {type:T; }> |Extract<ComponentInstance, {type:T; }> |Extract<Group, {type:T; }>)[]
Returns the elements of the given type.
Type Parameters
Section titled “Type Parameters”T extends "Edge" | "Face" | "ComponentInstance" | "Group" | "Guide"
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”(Extract<Guide, { type: T; }> | Extract<Edge, { type: T; }> | Extract<Face, { type: T; }> | Extract<ComponentInstance, { type: T; }> | Extract<Group, { type: T; }>)[]
toArray()
Section titled “toArray()”toArray():
AnyElement[]
A snapshot of the elements.
Returns
Section titled “Returns”transformEntities()
Section titled “transformEntities()”transformEntities(
transformation,entities):boolean
Moves elements of this context by a transformation in this context’s coordinates.
Shared boundary vertices move once. Returns false when entities is empty.
Parameters
Section titled “Parameters”transformation
Section titled “transformation”entities
Section titled “entities”Iterable<DrawingElement>
Returns
Section titled “Returns”boolean