DGKC Control Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Licensing
Expand ModelsModels
Expand DG Kernel ControlDG Kernel Control
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Expand General GeometryGeneral Geometry
Collapse ModelModel
Expand ViewView
Expand General ComputingGeneral Computing
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Support
Skip Navigation LinksHome Page > API Reference > Model > Entities > IEntity_DG Go to ActiveX docs Search Documentation


IEntity_DG Interface

Represents an entity

Typical methods of obtaning IEntity_DG: IModel_DG.GetEntityAt(); IEntity_DG.GetChildAt(); IObjectGenerator_DG.Create<Entity_DG>().

Implements also: IArray_DG (array of children), IMaterial_DG, ITexture_DG, IConstraint_DG, IMetrics_DG, IObject_DG, IUserData_DG, ISpinEffect_DG.

Properties

string Name
string GeometryType
bool Visible
bool Transient

Valid options for GeometryType property:

BRep
Mesh
3DS
SOR
SegmentStrip
KCBRep
Pipe
PointArray
Curve
Overlay
Label3D
Label3dManaged
ImageOriented
Measurement
ViewPoint

On changing the geometry type, if the requested type is different from the current type, the software replaces geometry of the entity with the new one. Where possible, its internal shape is copied (transformed) to the new type. The handler returns the new geometry for convenience. There is no need to call AttachGeometry() with the returned object. Density of the resulting mesh in case of type = "Mesh" can be controlled. Details.

Methods

GetGeometry
AttachGeometry
GetLocation
GetLocationDetached
GetAppearance
SetColor
SetVisible
GetChildCount
GetChildAt
GetEntity
GetLastChild
AddChild
Add
AddNewChild
AddNewChild1
AddChildBRepShape
AddNewChildBRepShape
AddNewChildBRepSolid
GetChildArray
GetEntities
GetEntityPath
RemoveAt
RemoveEntity
RemoveEntities
RemoveAll
Find
BuildChildToParentMap
GetBoundingBox
SaveAs
Copy
Clone
GetExtendedProperties
GetEnumerator

IGeometry_DG GetGeometry()


void AttachGeometry(IGeometry_DG geometry)

Changes or sets geometry of the entity. geometry can be created separately of obtained from another entity to share. Old geometry is released (and deleted is there were no other users for it)


IFrame_DG GetLocation()

Access to generic location, which includes orientation.


IFrame_DG GetLocationDetached()

A read-only version of GetLocation(). Modifications to the returned frame have no effect on the entity


IAppearance_DG GetAppearance()


void SetColor(float red, float green, float blue)

A simplified (shortcut) way to quickly change color of an entity. If the entity has material, values of ambient and diffuse components are set to the specified color


void SetVisible(bool visible, bool includeDescendents)


int GetChildCount()


IEntity_DG GetChildAt(int index)


IEntity_DG GetEntity(string path)

Accesses entities by their names. Allows retrieving entites on level deeper than the first. Similar to Windows file system paths, levels are separated by back slashes. path must be relative to this entity (the entity which implments this interface)

Examples:
MyTopBox
MyTopBox\ChildSphere\Cone
TopTorus\2
The second example is used in case when the third child has empty name string, in which case zero based indices are used. The search is case insencetive.


IEntity_DG GetLastChild()


void AddChild(IEntity_DG entity)


void Add(IEntityArray_DG entities, int insertAtOrNegative)


IEntity_DG AddNewChild()


IEntity_DG AddNewChild1(string type)

type specifies type of geometry. Valid values are listed at IEntity_DG.SetGeometryType()


IEntity_DG AddChildBRepShape(IBRepShape_DG shape)

Adds a new child entity with BRep type of geometry representing shape


IEntity_DG AddNewChildBRepShape(ShapeType_DG type)

Adds a new child entity with BRep type of geometry representing a new empty shape of the specified type


IEntity_DG AddNewChildBRepSolid()

Adds a new child entity with BRep type of geometry representing a new empty solid


IEntityArray_DG GetChildArray(bool includeDescendents)

if includeDescendents is true the returned array contains a flat array, which lists all descendents on all levels


IEntityArray_DG GetEntities(string path, bool includeDescendents)

if includeDescendents is true the returned array contains a flat array, which lists children of the entity at path and all its descendents on all levels


string GetEntityPath(IEntity_DG entity)

If entity is a descendent of this, returns path of entity relative to this. Otherwise returns an empty string.


void RemoveAt(int index)


bool RemoveEntity(IEntity_DG entity)

Removes an immediate child. Returns false if entity is not a child


void RemoveEntities(IEntityArray_DG entities)

If any entity in entities is a child of this it is removed from this


void RemoveAll(bool includingDescendantsFromParents)

Clears set of children of this. If includingDescendantsFromParents is true all descendents are removed (released) from their parents


int Find(IEntity_DG entity)

Returns 0-based index of an immediate child or -1


IMapUnkn_DG BuildChildToParentMap()

The returned map contains entities (map[IEntity_DG]) is an IEntity_DG) and is read-only in this release. map[iEntity] is parent of iEntity in hierarchy of descendents of this entity.
There is no GetParent() method as entities can be shared between models.


PairIntDg GetBoundingBox(bool includeDescendants)


bool SaveAs(string filePath, bool includeChildren)

The path can have any supported extension. Returns false in case of errors.


void Copy(IEntity_DG entity)


IEntity_DG Clone()


IDictionary_DG GetExtendedProperties()


IEnumerator GetEnumerator()

The returned IEnumerator interface type is part of Micorsoft .NET System.Collections namespace. This instance enumerates IEntity_DG of children of this entity.