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 | IfcAxis2Placement3D (#40) |
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(40));