
# IPCB_ComponentBody interface

A body that encapsulates a component in 3 dimensions on a PCB document; it is handled like other primitives and is contained in the component, whether in a library or on a board.

```csharp
public interface IPCB_ComponentBody : IPCB_Region
```

**Namespace:** PCB · **Assembly:** Altium.SDK.Interfaces

**Inherits:** [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) → [IPCB_Region](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md)

## Remarks

A component body is a child object of a component: to retrieve the bodies of a component, iterate over the component with a group iterator filtered to `TObjectId.eComponentBodyObject`.

A component body is a region with a 2D outline (it derives from [`IPCB_Region`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md)) and a 3D model (`Model`) that is an extruded shape, a cylinder, a sphere or a generic model loaded from a file.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [BodyColor3D](#bodycolor3d) | `uint` | get; set | The colour of the body in the 3D view. |
| [BodyOpacity3D](#bodyopacity3d) | `float` | get; set | The opacity of the body in the 3D view, from 0 (fully transparent) to 1 (opaque). |
| [BodyProjection](#bodyprojection) | [TBoardSide](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TBoardSide.md) | get; set | The side of the board the body is placed on. |
| [Identifier](#identifier) | `string` | set | The identifier of the body. |
| [Model](#model) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | get; set | The 3D model of the body. |
| [ModelHasChanged](#modelhaschanged) | `bool` | get | Whether the body's model has changed and must be rebuilt. |
| [OverallHeight](#overallheight) | `int` | get; set | The distance from the board surface to the far side of the body, in internal units (10,000 per mil). |
| [OverrideColor](#overridecolor) | `bool` | get; set |  |
| [SnapCount](#snapcount) | `int` | get; set | The number of snap points of the body, including the origin snap point at index 0. |
| [SnapPoint](#snappoint) | [CoordPoint3D](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordPoint3D.md) | get; set | The snap point at the given index, with X, Y and Z coordinates in internal units (10,000 per mil). |
| [StandoffHeight](#standoffheight) | `int` | get; set | The distance from the board surface to the near side of the body, in internal units (10,000 per mil). |
| [Texture](#texture) | `string` | get; set | The name of the texture image drawn on the body in the 3D view; empty for no texture. |
| [TextureCenter](#texturecenter) | [CoordPoint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordPoint.md) | get; set | The offset of the texture's center from the center of the body's bounding rectangle, in internal units (10,000 per mil). |
| [TextureRotation](#texturerotation) | `double` | get; set | The rotation of the texture, in degrees. |
| [TextureSize](#texturesize) | [CoordPoint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordPoint.md) | get; set | The width and height of the texture image on the board, in internal units (10,000 per mil). |

### BodyColor3D

The colour of the body in the 3D view.

```csharp
uint GetBodyColor3D();
void SetBodyColor3D(uint argValue);
```

**Type:** `uint` · **Access:** read/write

The colour is used for bodies whose model is not a generic model.

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L101)

### BodyOpacity3D

The opacity of the body in the 3D view, from 0 (fully transparent) to 1 (opaque).

```csharp
float GetBodyOpacity3D();
void SetBodyOpacity3D(float argValue);
```

**Type:** `float` · **Access:** read/write

Assigning a value outside 0 to 1 has no effect.

### BodyProjection

The side of the board the body is placed on.

```csharp
TBoardSide GetBodyProjection();
void SetBodyProjection(TBoardSide argValue);
```

**Type:** [TBoardSide](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TBoardSide.md) · **Access:** read/write

The accessors are extension methods of `IPCB_ComponentBodyHelper` (`using PCB;`).

[`StandoffHeight`](#standoffheight) and [`OverallHeight`](#overallheight) are measured from the board surface on this side, away from the board: up from the top surface for `TBoardSide.eBoardSide_Top`, down from the bottom surface for `TBoardSide.eBoardSide_Bottom`.

### Identifier

The identifier of the body.

```csharp
void SetState_Identifier(string argValue);
```

**Type:** `string` · **Access:** write-only

You can set it, for example, to the name of the STEP file that the body's model was loaded from.

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L102)

### Model

The 3D model of the body.

```csharp
IPCB_Model GetModel();
void SetModel(IPCB_Model argValue);
```

**Type:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) · **Access:** read/write

The accessors are extension methods of `IPCB_ComponentBodyHelper` (`using PCB;`).

A new body has an extruded model. Assigning a model stores a copy of it, so the assigned object can be destroyed afterwards with [`ModelFactory_Destroy`](#modelfactory_destroy). Assigning a model other than the current one also recalculates the body's outline and heights from the new model, as [`SetState_FromModel`](#setstate_frommodel) does; assigning the model the body already has (the object read from this property) does nothing. Assigning null removes the model.

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L99)

### ModelHasChanged

Whether the body's model has changed and must be rebuilt.

```csharp
bool GetState_ModelHasChanged();
```

**Type:** `bool` · **Access:** read-only

A new body starts with the value true. Assigning [`OverrideColor`](#overridecolor) sets it to true; [`ValidateMesh`](#validatemesh) sets it to false.

### OverallHeight

The distance from the board surface to the far side of the body, in internal units (10,000 per mil).

```csharp
int GetOverallHeight();
void SetOverallHeight(int argValue);
```

**Type:** `int` · **Access:** read/write

The distance is measured from the board surface on the side given by [`BodyProjection`](#bodyprojection), away from the board. For a body with an extruded model the value is the upper Z limit of the model, and assigning it changes that limit. For other models, assigning `Model` or calling [`SetState_FromModel`](#setstate_frommodel) recalculates the value from the model's extent.

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L98)

### OverrideColor

*No description yet.*

```csharp
bool GetOverrideColor();
void SetOverrideColor(bool argValue);
```

**Type:** `bool` · **Access:** read/write

Assigning a value sets [`ModelHasChanged`](#modelhaschanged) to true.

### SnapCount

The number of snap points of the body, including the origin snap point at index 0.

```csharp
int GetState_SnapCount();
void SetState_SnapCount(int argCount);
```

**Type:** `int` · **Access:** read/write

Assigning 0 or a negative value sets the count to 1, which keeps the origin snap point. Snap points added by increasing the count start at (0, 0, 0).

### SnapPoint

The snap point at the given index, with X, Y and Z coordinates in internal units (10,000 per mil).

```csharp
CoordPoint3D GetState_SnapPoint(int argIndex);
void SetState_SnapPoint(int argIndex, CoordPoint3D argPoint);
```

**Type:** [CoordPoint3D](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordPoint3D.md) · **Access:** read/write · **Index:** `argIndex` (`int`): The zero-based index of the snap point, from 0 to [`SnapCount`](#snapcount) - 1.

The accessors are extension methods of `IPCB_ComponentBodyHelper` (`using PCB;`).

The point at index 0 is the origin snap point; assigning it has no effect.

### StandoffHeight

The distance from the board surface to the near side of the body, in internal units (10,000 per mil).

```csharp
int GetStandoffHeight();
void SetStandoffHeight(int argValue);
```

**Type:** `int` · **Access:** read/write

The distance is measured from the board surface on the side given by [`BodyProjection`](#bodyprojection), away from the board. For a body with an extruded model the value is the lower Z limit of the model, and assigning it changes that limit. For other models, assigning `Model` or calling [`SetState_FromModel`](#setstate_frommodel) recalculates the value from the model's extent.

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L100)

### Texture

The name of the texture image drawn on the body in the 3D view; empty for no texture.

```csharp
string GetTexture();
void SetTexture(string argValue);
```

**Type:** `string` · **Access:** read/write

The texture is drawn only when the body's model is an extruded model.

### TextureCenter

The offset of the texture's center from the center of the body's bounding rectangle, in internal units (10,000 per mil).

```csharp
CoordPoint GetTextureCenter();
void SetTextureCenter(CoordPoint argValue);
```

**Type:** [CoordPoint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordPoint.md) · **Access:** read/write

The accessors are extension methods of `IPCB_ComponentBodyHelper` (`using PCB;`).

### TextureRotation

The rotation of the texture, in degrees.

```csharp
double GetTextureRotation();
void SetTextureRotation(double argValue);
```

**Type:** `double` · **Access:** read/write

### TextureSize

The width and height of the texture image on the board, in internal units (10,000 per mil).

```csharp
CoordPoint GetTextureSize();
void SetTextureSize(CoordPoint argValue);
```

**Type:** [CoordPoint](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/CoordPoint.md) · **Access:** read/write

The accessors are extension methods of `IPCB_ComponentBodyHelper` (`using PCB;`).

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [AddAxis](#addaxis) | [IPCB_Axis](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Axis.md) | Does nothing and returns null; no axis is added to the body. |
| [AxisCount](#axiscount) | `int` | Returns the number of axes of the body. |
| [ClearAxes](#clearaxes) | `void` | Removes all axes from the body. |
| [Fade](#fade) | `void` | Fades the body in the 3D view by the given amount, on top of any fade already applied. |
| [GetAxis](#getaxis) | [IPCB_Axis](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Axis.md) | Returns the axis at the given index. |
| [ModelFactory_Create](#modelfactory_create) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | Creates a model of the given type. |
| [ModelFactory_CreateCylinder](#modelfactory_createcylinder) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | Creates a cylinder model. |
| [ModelFactory_CreateExtruded](#modelfactory_createextruded) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | Creates an extruded model from the body's outline. |
| [ModelFactory_CreateSphere](#modelfactory_createsphere) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | Creates a sphere model. |
| [ModelFactory_Destroy](#modelfactory_destroy) | `void` | Destroys the given model. |
| [ModelFactory_FromFilename](#modelfactory_fromfilename) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | Creates a model from a 3D model file. |
| [ModelFactory_FromVault](#modelfactory_fromvault) | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | Creates a model from a revision of a 3D model item in a vault. |
| [ModelFactory_Replace](#modelfactory_replace) | `void` | Destroys a model and replaces the reference with a new model of the given type. |
| [ModelFactory_UpdateModel](#modelfactory_updatemodel) | `bool` | Changes the dimensions of the body's cylinder or sphere model. |
| [ResetDisplacement](#resetdisplacement) | `void` | Removes any temporary displacement transform applied to the body. |
| [ResetFade](#resetfade) | `void` | Removes the fade applied with `Fade`, so that the body is drawn with its [`BodyOpacity3D`](#bodyopacity3d). |
| [SaveModelToFile](#savemodeltofile) | `bool` | Saves the body's model to a file. |
| [SetState_FromModel](#setstate_frommodel) | `void` | Recalculates the body's outline and heights from its model. |
| [UniqueName](#uniquename) | `string` | Returns a text that identifies the body's model. |
| [ValidateMesh](#validatemesh) | `void` | Rebuilds the body's extruded model when it has changed. |

### AddAxis

Does nothing and returns null; no axis is added to the body.

```csharp
IPCB_Axis AddAxis();
```

**Returns:** [IPCB_Axis](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Axis.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

### AxisCount

Returns the number of axes of the body.

```csharp
int AxisCount();
```

**Returns:** `int`

### ClearAxes

Removes all axes from the body.

```csharp
void ClearAxes();
```

**Returns:** nothing (`void`)

### Fade

Fades the body in the 3D view by the given amount, on top of any fade already applied.

```csharp
void Fade(float argValue);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argValue` | `float` | value | The fade amount, from 0 (no change) to 1 (fully faded). |

**Returns:** nothing (`void`)

Each call multiplies the remaining opacity by 1 minus the amount, and the body is drawn with [`BodyOpacity3D`](#bodyopacity3d) multiplied by the remaining opacity. [`BodyOpacity3D`](#bodyopacity3d) itself does not change; [`ResetFade`](#resetfade) removes the fade.

### GetAxis

Returns the axis at the given index.

```csharp
IPCB_Axis GetAxis(int argIndex);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argIndex` | `int` | value | The zero-based index of the axis, from 0 to [`AxisCount`](#axiscount) - 1. |

**Returns:** [IPCB_Axis](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Axis.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

### ModelFactory_Create

Creates a model of the given type.

```csharp
IPCB_Model ModelFactory_Create(T3DModelType argModelType);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argModelType` | [T3DModelType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/T3DModelType.md) | value | The type of the model to create. |

**Returns:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

The model is not attached to the body; assign it to `Model` to use it.

### ModelFactory_CreateCylinder

Creates a cylinder model.

```csharp
IPCB_Model ModelFactory_CreateCylinder(int argRadius, int argHeight, uint argColor);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argRadius` | `int` | value | The radius of the cylinder, in internal units (10,000 per mil). |
| `argHeight` | `int` | value | The height of the cylinder, in internal units (10,000 per mil). |
| `argColor` | `uint` | value | The colour of the model. |

**Returns:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

The model is not attached to the body; assign it to `Model` to use it.

### ModelFactory_CreateExtruded

Creates an extruded model from the body's outline.

```csharp
IPCB_Model ModelFactory_CreateExtruded(int argMinZ, int argMaxZ, uint argColor);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argMinZ` | `int` | value | The near Z limit of the extrusion (the standoff height), in internal units (10,000 per mil). |
| `argMaxZ` | `int` | value | The far Z limit of the extrusion (the overall height), in internal units (10,000 per mil). |
| `argColor` | `uint` | value | The colour of the model. |

**Returns:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

When the outline has an area and `argMaxZ` is greater than `argMinZ`, the outline is extruded from `argMinZ` to `argMaxZ`; otherwise the model gets only that Z range. The call also sets the body's [`StandoffHeight`](#standoffheight) to `argMinZ` and [`OverallHeight`](#overallheight) to `argMaxZ`. The model is not attached to the body; assign it to `Model` to use it.

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L93)

### ModelFactory_CreateSphere

Creates a sphere model.

```csharp
IPCB_Model ModelFactory_CreateSphere(int argRadius, uint argColor);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argRadius` | `int` | value | The radius of the sphere, in internal units (10,000 per mil). |
| `argColor` | `uint` | value | The colour of the model. |

**Returns:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

The model is not attached to the body; assign it to `Model` to use it.

### ModelFactory_Destroy

Destroys the given model.

```csharp
void ModelFactory_Destroy(ref IPCB_Model argValue);
void ModelFactory_Destroy(ref object argValue);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argValue` | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | ref | The model to destroy. |

**Returns:** nothing (`void`)

The first overload is an extension method of `IPCB_ComponentBodyHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

Does nothing when `argValue` is null. The reference passed in is not set to null.

### ModelFactory_FromFilename

Creates a model from a 3D model file.

```csharp
IPCB_Model ModelFactory_FromFilename(string argFileName, bool argWatchDirectory);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argFileName` | `string` | value | The path of the 3D model file. |
| `argWatchDirectory` | `bool` | value |  |

**Returns:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

The model is not attached to the body; assign it to `Model` to use it.

### ModelFactory_FromVault

Creates a model from a revision of a 3D model item in a vault.

```csharp
IPCB_Model ModelFactory_FromVault(string argTitle, string argVaultGUID, string argItemGUID, string argItemRevisionGUID);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argTitle` | `string` | value | The name given to the created model. |
| `argVaultGUID` | `string` | value | The GUID of the vault that holds the item. |
| `argItemGUID` | `string` | value | The GUID of the item. |
| `argItemRevisionGUID` | `string` | value | The GUID of the item revision. |

**Returns:** [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md)

Extension method of `IPCB_ComponentBodyHelper` (`using PCB;`).

### ModelFactory_Replace

Destroys a model and replaces the reference with a new model of the given type.

```csharp
void ModelFactory_Replace(T3DModelType argModelType, ref IPCB_Model argValue);
void ModelFactory_Replace(int argModelType, ref object argValue);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argModelType` | [T3DModelType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/T3DModelType.md) | value | The type of the new model. |
| `argValue` | [IPCB_Model](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Model.md) | ref | The model to destroy; receives the new model. |

**Returns:** nothing (`void`)

The first overload is an extension method of `IPCB_ComponentBodyHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

The body's own model is not changed.

### ModelFactory_UpdateModel

Changes the dimensions of the body's cylinder or sphere model.

```csharp
bool ModelFactory_UpdateModel(int argRadius, int argHeight, T3DModelType argModelType);
bool ModelFactory_UpdateModel(int argRadius, int argHeight, int argModelType);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argRadius` | `int` | value | The new radius, in internal units (10,000 per mil). |
| `argHeight` | `int` | value | The new height of a cylinder, in internal units (10,000 per mil); not used for a sphere. |
| `argModelType` | [T3DModelType](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/T3DModelType.md) | value | Not used; the type of the body's current model decides what is changed. |

**Returns:** `bool`

The first overload is an extension method of `IPCB_ComponentBodyHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

For a cylinder model the radius and the height are set; for a sphere model the radius. Does nothing when the body has no model or its model is an extruded or a generic model. The method always returns false.

### ResetDisplacement

Removes any temporary displacement transform applied to the body.

```csharp
void ResetDisplacement();
```

**Returns:** nothing (`void`)

### ResetFade

Removes the fade applied with `Fade`, so that the body is drawn with its [`BodyOpacity3D`](#bodyopacity3d).

```csharp
void ResetFade();
```

**Returns:** nothing (`void`)

### SaveModelToFile

Saves the body's model to a file.

```csharp
bool SaveModelToFile(string argFullPath);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argFullPath` | `string` | value | The full path of the file to write. |

**Returns:** `bool`

When the model is a generic model loaded from a file with the same extension as `argFullPath`, the original model file is copied; otherwise the model is exported as a STEP file, except for a `.sldprt` target, which is written only by copying. Returns true when the file was written.

### SetState_FromModel

Recalculates the body's outline and heights from its model.

```csharp
void SetState_FromModel();
```

**Returns:** nothing (`void`)

For a model that is not an extruded model, the outline becomes a rectangle around the model's extent in the board plane, turned by the model's Z rotation, and [`StandoffHeight`](#standoffheight) and [`OverallHeight`](#overallheight) are set from the model's lowest and highest Z. For an extruded model, the outline and heights are kept and the model's origin is moved to the center of the body's bounding rectangle. Does nothing when the body has no model or the model is empty.

### UniqueName

Returns a text that identifies the body's model.

```csharp
string UniqueName();
```

**Returns:** `string`

For a non-empty model it is a text that identifies the loaded model data during the current session; it is not persistent. For an empty model it is the model's GUID.

### ValidateMesh

Rebuilds the body's extruded model when it has changed.

```csharp
void ValidateMesh();
```

**Returns:** nothing (`void`)

When [`ModelHasChanged`](#modelhaschanged) is true and the model is an extruded model, the model is created again from the body's current outline and the model's Z limits, and the outline and heights are recalculated as by [`SetState_FromModel`](#setstate_frommodel). The rebuild needs an outline with an area and at least 3 vertices and an upper Z limit greater than the lower one. Afterwards [`ModelHasChanged`](#modelhaschanged) is false when the body has a model.

## Inherited members

- From [IPCB_Region](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md): [Area](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#area), [CavityHeight](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#cavityheight), [GeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#geometricpolygon), [GetHole](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#gethole), [GetHoleCount](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#getholecount), [GetMainContour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#getmaincontour), [IsSimpleRegion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#issimpleregion), [Kind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#kind), [Name](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#name), [RotateAroundXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#rotatearoundxy), [SetOutlineContour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region.md#setoutlinecontour)
- From [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md): [AllowGlobalEdit](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#allowglobaledit), [BeginModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#beginmodify), [Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#board), [BoundingRectangle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangle), [BoundingRectangleChildren](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectanglechildren), [BoundingRectangleForPainting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforpainting), [BoundingRectangleForSelection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforselection), [CancelModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#cancelmodify), [Component](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#component), [Coordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#coordinate), [DescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#descriptorstring), [DetailString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#detailstring), [Dimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#dimension), [DrawAsPreview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drawaspreview), [DRCError](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drcerror), [Enabled](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled), [Enabled_Direct](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_direct), [Enabled_vComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcomponent), [Enabled_vCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcoordinate), [Enabled_vDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vdimension), [Enabled_vNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vnet), [Enabled_vPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vpolygon), [EnableDraw](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabledraw), [EndModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#endmodify), [Export_ToParameters](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#export_toparameters), [FlipXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#flipxy), [GraphicallyInvalidate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#graphicallyinvalidate), [Handle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#handle), [InBoard](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inboard), [InComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incomponent), [InCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incoordinate), [Index](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#index), [InDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#indimension), [InNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#innet), [InPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inpolygon), [InSelectionMemory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inselectionmemory), [IsAssyTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_bottom), [IsAssyTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_top), [IsElectricalPrim](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iselectricalprim), [IsFreePrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isfreeprimitive), [IsHidden](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ishidden), [IsKeepout](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iskeepout), [IsPreRoute](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ispreroute), [IsSaveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#issaveable), [IsTenting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting), [IsTenting_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_bottom), [IsTenting_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_top), [IsTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_bottom), [IsTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_top), [Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#layer), [MiscFlag1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag1), [MiscFlag2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag2), [MiscFlag3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag3), [Moveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#moveable), [MoveByXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movebyxy), [MoveToXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movetoxy), [Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#net), [ObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectid), [ObjectIDString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectidstring), [PadCacheRobotFlag](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#padcacherobotflag), [PasteMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#pastemaskexpansion), [Polygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygon), [PolygonOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygonoutline), [PowerPlaneClearance](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneclearance), [PowerPlaneConnectStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneconnectstyle), [PowerPlaneReliefExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplanereliefexpansion), [Preview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#preview), [ReliefAirGap](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefairgap), [ReliefConductorWidth](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefconductorwidth), [ReliefEntries](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefentries), [Replicate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#replicate), [RequiredParamterSpace](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#requiredparamterspace), [RotateBy](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#rotateby), [Selected](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#selected), [SolderMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#soldermaskexpansion), [SwapLayerPairs](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#swaplayerpairs), [TearDrop](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#teardrop), [UnionIndex](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#unionindex), [UniqueId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid), [UniqueID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid-1), [Used](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#used), [UserRouted](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#userrouted), [V7Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#v7layer), [ViewableObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#viewableobjectid)

## Examples

Used in the SDK examples: [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L51).
