BIM VILLAGE

Version 2.5.2

SampleCreateIfcAxis2Placement3D

Overview

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

Sample code

For example:

Name Value
Location 0.000000,0.000000,0.000000
Refdirection 1.000000,0.000000,0.000000
Axis 0.000000,0.000000,1.000000
var app = new Beaver.BcadApplication();
var doc = app.ActiveDocument;
if (doc == null)
    doc = app.Documents.Add();
var stp = doc.STEPDocument;
var IfcAxis2Placement3D = stp.Instnaces.CreateInstance("IfcAxis2Placement3D"); {
	var location = stp.Instnaces.CreateInstance("IfcCartesianPoint");  {
		double []values={0,0,0};
		location.Attributes.AttributeAsAggregate("coordinates").values = values;
	}
	var refdirection = stp.Instnaces.CreateInstance("IfcDirection"); {
		double []values={1,0,0};
		refdirection.Attributes.AttributeAsAggregate("directionratios").values = values;
	}
	var axis = stp.Instnaces.CreateInstance("IfcDirection"); {
		double []values={0,0,1};
		refdirection.Attributes.AttributeAsAggregate("directionratios").values = values;
	}
	IfcAxis2Placement3D.Attributes.AttributeAsInst("location").Value = location;
	IfcAxis2Placement3D.Attributes.AttributeAsInst("refdirection").Value = refdirection;
	IfcAxis2Placement3D.Attributes.AttributeAsInst("axis").Value = axis;
}

© 2019 - 2022 BIM VILLAGE.