BIM VILLAGE

Version 2.5.1

SampleCreateIfcGeometricRepresentationContext

Overview

This programming manual in C# offers a practical demonstration of how to create an instance of the IfcGeometricRepresentationContext class within a model.

Sample code

For example:

Name Value
ContextType Plan
ContextIdentifier
CoordinateSpaceDimension 3
Precision 0
WorldCoordinateSystem
var app = new Beaver.BcadApplication();
var doc = app.ActiveDocument;
if (doc == null)
    doc = app.Documents.Add();
var stp = doc.STEPDocument;
var IfcGeometricRepresentationContext = stp.Instnaces.CreateInstance("IfcGeometricRepresentationContext");
IfcGeometricRepresentationContext.Attributes.AttributeAsStr("ContextIdentifier").Value = "";
IfcGeometricRepresentationContext.Attributes.AttributeAsStr("ContextType").Value = "Plan";
IfcGeometricRepresentationContext.Attributes.AttributeAsInt("CoordinateSpaceDimension").Value = 3;
IfcGeometricRepresentationContext.Attributes.AttributeAsReal("Precision").Value = 0;
IfcGeometricRepresentationContext.Attributes.AttributeAsSelect("WorldCoordinateSystem").SetValueAsInst(stp.Instnaces.FindInstance(-1));

© 2019 - 2022 BIM VILLAGE.