v2.46
 
IRoomRegionDescription Interface Reference

The description of the calculated room region. This interface can be obtained with IRoom::CalculateRegion method. More...

Public Member Functions

HRESULT GetObjectId ([in] int regionCurveTrackingId, [out, retval] int *pObjectId)
 Returns the id of the object that the curve of the room region with given regionCurveTrackingId corresponds to.
 

Properties

IRegion2D Region [get]
 The calculated region of the room. The calculated region contains all the contours created by walls, columns, wall foundations, isolated foundations and other rooms inside the room.
 

Detailed Description

The description of the calculated room region. This interface can be obtained with IRoom::CalculateRegion method.

See also
IRoom, IRegion2D

Member Function Documentation

◆ GetObjectId()

HRESULT GetObjectId ( [in] int regionCurveTrackingId,
[out, retval] int * pObjectId )

Returns the id of the object that the curve of the room region with given regionCurveTrackingId corresponds to.

Parameters
[in]regionCurveTrackingIdTracking id of the curve of the room region. The curve tracking id can be obtained using the ICurve2D::TrackingId.
[out]pObjectIdId of the object that the curve with given curveId corresponds to.
Note
This method works only with curve tracking ids that obtained from the room region. To get such curve ids, first obtain a region using the Region property, then decompose it into curves with IPolyCurve2D interface.

See an example of using this method below:

var modelObjects = app.Project.Model.GetObjects();
IRoom room = modelObjects.GetById(someRoomId) as IRoom; // getting room object as IRoom
IRoomRegionDescription roomRegionDescription = room.CalculateRegion(roomPoint); // getting the IRoomRegionDescription
IRegion2D roomRegion = roomRegionDescription.Region; // getting the room region
IPolyCurve2D roomRegionOuterContour = roomRegion.GetOuterContour() as IPolyCurve2D; // decomposing outer contour of region into curves
for (var i = 0; i < roomRegionOuterContour.GetSegmentCount(); ++i)
{
ICurve2D roomRegionCurve = roomRegionOuterContour.GetSegment(i);
int curveTrackingId = roomRegionCurve.TrackingId; // getting the tracking id of the curve from room region
int objectId = roomRegionDescription.GetObjectId(curveTrackingId); // getting id of object that the roomRegionCurve corresponds to
IModelObject modelObject = modelObjects.GetById(objectId); // getting the model object, for example, a wall
// ... working with modelObject ...
}
Represents a generic curve in two-dimensional space. A generic curve is a vector function of a scalar...
Definition ICurve2D.idl:25
int TrackingId
The tracking identifier of the curve. Tracking identifier is used to identify the curve between geome...
Represents any Renga model object.
Definition IModelObject.idl:22
Represents a curve in two-dimensional space that consists of several joined curves.
Definition IPolyCurve2D.idl:18
HRESULT GetSegmentCount([out, retval] int *pCount)
Returns the number of polycurve segments.
HRESULT GetSegment([in] int index, [out, retval] ICurve2D **ppCurve2D)
Returns a polycurve segment by index.
Region in two-dimensional space.
Definition IRegion2D.idl:27
HRESULT GetOuterContour([out, retval] ICurve2D **ppContour2D)
Returns the outer contour of the region.
Represents a room object. A room represents a volume bounded actually or theoretically.
Definition IRoom.idl:22
HRESULT CalculateRegion([in] Point2D roomPoint, [out, retval] IRoomRegionDescription **ppRoomRegionDescription)
Calculates the region of the room around the given point and returns the result of the calculation as...
The description of the calculated room region. This interface can be obtained with IRoom::CalculateRe...
Definition IRoomRegionDescription.idl:21
HRESULT GetObjectId([in] int regionCurveTrackingId, [out, retval] int *pObjectId)
Returns the id of the object that the curve of the room region with given regionCurveTrackingId corre...
IRegion2D Region
The calculated region of the room. The calculated region contains all the contours created by walls,...
See also
IRoom::CalculateRegion, IPolyCurve2D, ICurve2D::TrackingId

Property Documentation

◆ Region

IRegion2D Region
get

The calculated region of the room. The calculated region contains all the contours created by walls, columns, wall foundations, isolated foundations and other rooms inside the room.

!

See also
IRoom::CalculateRegion, IRegion2D