Hide menu
Loading...
Searching...
No Matches
View

Represents a view on a drawing sheet.

Usually a view is a logical portion of the sheet, containing one of the literal views of the model (for example, top view, isometric view, or cutaway view). Following this idea, the view is defined by a position in the sheet and a scale (real-world model dimensions versus on-paper dimensions).

A view can contain any collection of drawing elements, but these elements are expected to form a logically self-contained group.

Extends

Constructors

Constructor

new View(position?): View

Creates a view.

The provided position is copied.

Parameters

position?

Axis2d = ...

Position of the view in the owning sheet.

Returns

View

Overrides

BaseObject.constructor

Properties

elements

readonly elements: Set<Element>

Elements contained in the view.

Accessors

id

Get Signature

get id(): bigint

Returns the unique identifier of the object.

Returns

bigint

Inherited from

BaseObject.id


numberOfElements

Get Signature

get numberOfElements(): number

Returns the number of elements in the view.

Deprecated

Use View.elements and elements.size instead.

Returns

number


position

Get Signature

get position(): Axis2d

Position of the view in the owning sheet.

Returns

Axis2d

Set Signature

set position(position): void

Sets the position of the view in the owning sheet.

The value is copied from the provided axis.

Parameters

position

Axis2d

Position of the view in the owning sheet.

Returns

void


scale

Get Signature

get scale(): Ratio

Scale of the view.

Returns

Ratio

Set Signature

set scale(scale): void

Sets the scale of the view.

The value is copied from the provided ratio.

Parameters

scale

Ratio

View scale.

Returns

void


uuid

Get Signature

get uuid(): `${string}-${string}-${string}-${string}-${string}` | null

UUID of the drawing view.

The value is null if the drawing view has no assigned UUID.

Returns

`${string}-${string}-${string}-${string}-${string}` | null

Set Signature

set uuid(uuid): void

Sets the UUID of the drawing view.

Parameters

uuid

`${string}-${string}-${string}-${string}-${string}` | null

UUID of the drawing view.

Returns

void

Methods

accept()

accept(visitor): void

Accepts an element visitor.

Calls the visitor for each element in the view.

Parameters

visitor

ElementVisitor

Element visitor to accept.

Returns

void


add()

add(element): void

Adds a drawing element to the view.

Parameters

element

Element

Drawing element to add.

Returns

void

Deprecated

Use View.elements and elements.add(element) instead.