SampleCreateIfcRectangleProfileDef
Overview
This programming manual in C# offers a practical demonstration of how to create an instance of the IfcRectangleProfileDef class within a model.
Sample code
For example:
Name | Value |
---|---|
ProfileName | C1 |
XDim | 500 |
YDim | 500 |
Position | IfcAxis2Placement2D (#126) |
ProfileType | curve |
var app = new Beaver.BcadApplication();
var doc = app.ActiveDocument;
if (doc == null)
doc = app.Documents.Add();
var stp = doc.STEPDocument;
var IfcRectangleProfileDef = stp.Instnaces.CreateInstance("IfcRectangleProfileDef");
IfcRectangleProfileDef.Attributes.AttributeAsStr("ProfileName").Value = "C1";
IfcRectangleProfileDef.Attributes.AttributeAsReal("XDim").Value = 500;
IfcRectangleProfileDef.Attributes.AttributeAsReal("YDim").Value = 500;
IfcRectangleProfileDef.Attributes.AttributeAsEnum("ProfileType").SetValue("curve");
IfcRectangleProfileDef.Attributes.AttributeAsInst("position").Value = stp.Instnaces.FindInstance(126);