DG Kernel Documentation


Skip Navigation Links.
Skip Navigation LinksHome Page > API Reference > Model > Entities > IEntity_DG Search Documentation


IEntity_DG Interface

GetName
SetName
GetGeometryType
SetGeometryType
GetGeometry
AttachGeometry
GetLocation
GetAppearance
SetColor
IsVisible
SetVisible
IsTransient
SetTransient
GetChildCount
GetChildAt
GetEntity
GetLastChild
AddChild
Add
AddNewChild
AddNewChild1
AddChildBRepShape
AddNewChildBRepShape
AddNewChildBRepSolid
GetChildArray
GetEntities
GetEntityPath
RemoveAt
RemoveEntity
RemoveEntities
RemoveAll
Find
BuildChildToParentMap
GetBoundingBox
SaveAs
Copy
Clone

Represents an entity


string GetName()


void SetName(string name)


string GetGeometryType()

IGeometry_DG SetGeometryType(string type)

Valid options for type parameter:

BRep
Mesh
3DS
SOR
SegmentStrip
KCBRep
Pipe
PointArray
Line
Overlay
Label
BRepText
ImageOriented
Measurement

If the requested type is different from the current type, the method replaces geometry of the entity with the new one. Where possible, its internal shape is copied (transformed) to the new type

The method returns the new geometry for convenience. There is no need to call AttachGeometry() with the returned object


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.


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


bool IsVisible()


void SetVisible(bool visible)


bool IsTransient()

Returns the flag, which determines whether the entity is excluded from saving to file system operations


void SetTransient(bool transient)

Determines whether the entity should be excluded from saving to file system operations


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 indecies 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.


Box_DG 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()