Hide menu
Loading...
Searching...
No Matches
Part

Defines a leaf node in the scene graph hierarchy.

A part corresponds to a mechanical part or a product in the product structure hierarchy.

A part may contain one or more bodies.

Extends

Constructors

Constructor

new Part(name?): Part

Creates a model element with an optional name.

Parameters

name?

string | null

Name assigned to the model element.

Returns

Part

Inherited from

ModelElement.constructor

Properties

bodies

readonly bodies: Set<Body>

Collection of bodies belonging to the part.


material

material: VisualMaterial | null = null

Visual material assigned to the model element.

The default value is null.

Inherited from

Assembly.material

Accessors

id

Get Signature

get id(): bigint

Returns the unique identifier of the object.

Returns

bigint

Inherited from

ModelElement.id


name

Get Signature

get name(): string | null

Name of the model element.

The default value is null.

Returns

string | null

Set Signature

set name(name): void

Sets the name of the model element.

Parameters

name

string | null

Model element name.

Returns

void

Inherited from

ModelElement.name


numberOfBodies

Get Signature

get numberOfBodies(): number

Returns the number of bodies in the part.

Deprecated

Use Part.bodies and bodies.size instead.

Returns

number


uuid

Get Signature

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

UUID of the model element.

The default value is null.

Returns

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

Set Signature

set uuid(uuid): void

Sets the UUID of the model element.

Parameters

uuid

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

Model element UUID.

Returns

void

Inherited from

ModelElement.uuid

Methods

accept()

accept(visitor): void

Accepts an element visitor.

Invokes visitPart() for this part.

Parameters

visitor

ModelElementVisitor

Visitor to accept.

Returns

void

Overrides

ModelElement.accept


addBodies()

addBodies(bodies): void

Adds bodies to the part.

Bodies that are already present in the part are not added again.

Parameters

bodies

Body[]

Bodies to add.

Returns

void

Deprecated

Use Part.bodies and bodies.forEach((body) => part.bodies.add(body)) instead.


addBody()

addBody(body): void

Adds a body to the part.

If body is already present in the part, it is not added again.

Parameters

body

Body

Body to add.

Returns

void

Deprecated

Use Part.bodies and bodies.add(body) instead.