Show / Hide Table of Contents

Class Insert

Represents a block insertion EntityObject.

Inheritance
System.Object
DxfObject
EntityObject
Insert
Implements
IHasXData
System.ICloneable
Inherited Members
EntityObject.LayerChanged
EntityObject.OnLayerChangedEvent(Layer, Layer)
EntityObject.LinetypeChanged
EntityObject.OnLinetypeChangedEvent(Linetype, Linetype)
EntityObject.XDataAddAppReg
EntityObject.OnXDataAddAppRegEvent(ApplicationRegistry)
EntityObject.XDataRemoveAppReg
EntityObject.OnXDataRemoveAppRegEvent(ApplicationRegistry)
EntityObject.Reactors
EntityObject.Type
EntityObject.Color
EntityObject.Layer
EntityObject.Linetype
EntityObject.Lineweight
EntityObject.Transparency
EntityObject.LinetypeScale
EntityObject.IsVisible
EntityObject.Normal
EntityObject.Owner
EntityObject.XData
EntityObject.TransformBy(Matrix4)
EntityObject.ToString()
DxfObject.CodeName
DxfObject.Handle
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public class Insert : EntityObject, IHasXData, ICloneable

Constructors

| Improve this Doc View Source

Insert(Block)

Initializes a new instance of the Insert class.

Declaration
public Insert(Block block)
Parameters
Type Name Description
Block block

Insert Block.

| Improve this Doc View Source

Insert(Block, Vector2)

Initializes a new instance of the Insert class.

Declaration
public Insert(Block block, Vector2 position)
Parameters
Type Name Description
Block block

Insert block definition.

Vector2 position

Insert Vector2 in world coordinates.

| Improve this Doc View Source

Insert(Block, Vector3)

Initializes a new instance of the Insert class.

Declaration
public Insert(Block block, Vector3 position)
Parameters
Type Name Description
Block block

Insert block definition.

Vector3 position

Insert Vector3 in world coordinates.

| Improve this Doc View Source

Insert(Block, Vector3, Double)

Initializes a new instance of the Insert class.

Declaration
public Insert(Block block, Vector3 position, double scale)
Parameters
Type Name Description
Block block

Insert block definition.

Vector3 position

Insert Vector3 in world coordinates.

System.Double scale

Properties

| Improve this Doc View Source

Attributes

Gets the insert list of Attribute.

Declaration
public AttributeCollection Attributes { get; }
Property Value
Type Description
AttributeCollection
| Improve this Doc View Source

Block

Gets the insert Block.

Declaration
public Block Block { get; }
Property Value
Type Description
Block
| Improve this Doc View Source

DefaultInsUnits

Gets or sets the default drawing units to obtain the Insert transformation matrix, when the current Insert entity does not belong to a DXF document.

Declaration
public static DrawingUnits DefaultInsUnits { get; set; }
Property Value
Type Description
DrawingUnits
| Improve this Doc View Source

Position

Gets or sets the Vector3 in world coordinates.

Declaration
public Vector3 Position { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

Rotation

Gets or sets the insert rotation along the normal vector in degrees.

Declaration
public double Rotation { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Scale

Gets or sets the insert Vector3.

Declaration
public Vector3 Scale { get; set; }
Property Value
Type Description
Vector3
Remarks

None of the vector scale components can be zero.

Methods

| Improve this Doc View Source

Clone()

Creates a new Insert that is a copy of the current instance.

Declaration
public override object Clone()
Returns
Type Description
System.Object

A new Insert that is a copy of this instance.

Overrides
EntityObject.Clone()
| Improve this Doc View Source

Explode()

Explodes the current insert.

Declaration
public List<EntityObject> Explode()
Returns
Type Description
System.Collections.Generic.List<EntityObject>

A list of entities.

| Improve this Doc View Source

GetTransformation()

Calculates the insertion rotation matrix.

Declaration
public Matrix3 GetTransformation()
Returns
Type Description
Matrix3

The insert transformation matrix.

Remarks

This method uses the DefaultInsUnits defined by the Insert class to obtain the scale between the drawing and the block units. Additionally, if the insert belongs to a block the units to use are the ones defined in the BlockRecord, and if the insert belongs to a layout the units to use are the ones defined in the document drawing variable InsUnits.

| Improve this Doc View Source

GetTransformation(DrawingUnits)

Calculates the insertion rotation matrix.

Declaration
public Matrix3 GetTransformation(DrawingUnits insertionUnits)
Parameters
Type Name Description
DrawingUnits insertionUnits

The insertion units.

Returns
Type Description
Matrix3

The insert transformation matrix.

| Improve this Doc View Source

OnAttributeAddedEvent(Attribute)

Declaration
protected virtual void OnAttributeAddedEvent(Attribute item)
Parameters
Type Name Description
Attribute item
| Improve this Doc View Source

OnAttributeRemovedEvent(Attribute)

Declaration
protected virtual void OnAttributeRemovedEvent(Attribute item)
Parameters
Type Name Description
Attribute item
| Improve this Doc View Source

Sync()

Updates the actual insert with the attribute properties currently defined in the block. This does not affect any values assigned to attributes in each block.

Declaration
public void Sync()
Remarks

This method will automatically call the TransformAttributes method, to keep all attributes position and orientation up to date.

| Improve this Doc View Source

TransformAttributes()

Recalculate the attributes position, normal, rotation, text height, width factor, and oblique angle from the values applied to the insertion.

Declaration
public void TransformAttributes()
Remarks

Changes to the insert, the block, or the document insertion units will require this method to be called manually.
The attributes position, normal, rotation, text height, width factor, and oblique angle values includes the transformations applied to the insertion, if required this method will calculate the proper values according to the ones defined by the attribute definition.
All the attribute values can be changed manually independently to its definition, but, usually, you will want them to be transformed with the insert based on the local values defined by the attribute definition.
This method only applies to attributes that have a definition, some DXF files might generate attributes that have no definition in the block.
At the moment the attribute width factor and oblique angle are not calculated, this is applied to inserts with non uniform scaling.

| Improve this Doc View Source

TransformBy(Matrix3, Vector3)

Moves, scales, and/or rotates the current entity given a 3x3 transformation matrix and a translation vector.

Declaration
public override void TransformBy(Matrix3 transformation, Vector3 translation)
Parameters
Type Name Description
Matrix3 transformation

Transformation matrix.

Vector3 translation

Translation vector.

Overrides
EntityObject.TransformBy(Matrix3, Vector3)
Remarks

Matrix3 adopts the convention of using column vectors to represent a transformation matrix.

Events

| Improve this Doc View Source

AttributeAdded

Declaration
public event Insert.AttributeAddedEventHandler AttributeAdded
Event Type
Type Description
Insert.AttributeAddedEventHandler
| Improve this Doc View Source

AttributeRemoved

Declaration
public event Insert.AttributeRemovedEventHandler AttributeRemoved
Event Type
Type Description
Insert.AttributeRemovedEventHandler

Implements

IHasXData
System.ICloneable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX