Overview

The IFC project is the root instance for an IFC data set. It declares the units used by the data and is the starting point for any traversal of the spatial structure. A file typically only has one project, but may reference a project library.

The functions below simplify finding the project and units that apply to a given IFC file.

ifcx_project_angle_unit()

RoseUnit ifcx_project_angle_unit(RoseDesign * d);
RoseUnit ifcx_project_angle_unit(IfcContext * p);

The ifcx_project_angle_unit() function searches the IfcUnitAssignment associated with the given project for the angle unit that applies to the data.

This function expects the units to have been previously recognized and tagged with the ifcx_unit_tag() function. It will return roseunit_unknown if the units have not been tagged or if the unit described by the data object was not recognized.

ifcx_project_find()

IfcContext * ifcx_project_find(RoseDesign * d);

The ifcx_project_find() function finds the first (and usually only) IfcProject instance in a file. If no project is found, it will search for an IfcProjectLibrary instance.

ifcx_project_find_unit()

RoseUnit ifcx_project_find_unit (
	RoseDesign * d,	// use first project 
	RoseMeasureType vt
	);
RoseUnit ifcx_project_find_unit (
	IfcContext * project,
	RoseMeasureType vt
	);

The ifcx_project_find_unit() function searches the IfcUnitAssignment associated with the given project for a unit of the given type and returns the RoseUnit enum describing that unit. The ifcx_project_angle_unit(), ifcx_project_length_unit(), and ifcx_project_solid_angle_unit() functions are wrappers that call this function to search for angle, length, and solid angle units.

This function expects the units to have been previously recognized and tagged with the ifcx_unit_tag() function. It will return roseunit_unknown if the units have not been tagged or if the unit described by the data object was not recognized.

ifcx_project_find_unit_item()

IfcUnit * ifcx_project_find_unit_item (
	RoseDesign * d,	// use first project 
	RoseMeasureType vt
	);
IfcUnit * ifcx_project_find_unit_item (
	IfcContext * project,
	RoseMeasureType vt
	);

The ifcx_project_find_unit_item() function searches the IfcUnitAssignment associated with the given project for a unit of the given type and returns the IFC instance data for that unit.

This function expects the units to have been previously recognized and tagged with the ifcx_unit_tag() function. It will return roseunit_unknown if the units have not been tagged or if the unit described by the data object was not recognized.

ifcx_project_length_unit()

RoseUnit ifcx_project_length_unit(RoseDesign * d);
RoseUnit ifcx_project_length_unit(IfcContext * p);

The ifcx_project_length_unit() function searches the IfcUnitAssignment associated with the given project for the length unit that applies to the data.

This function expects the units to have been previously recognized and tagged with the ifcx_unit_tag() function. It will return roseunit_unknown if the units have not been tagged or if the unit described by the data object was not recognized.

ifcx_project_solid_angle_unit()

RoseUnit ifcx_project_solid_angle_unit(RoseDesign * d);
RoseUnit ifcx_project_solid_angle_unit(IfcContext * p);

The ifcx_project_solid_angle_unit() function searches the IfcUnitAssignment associated with the given project for the solid angle unit that applies to the data.

This function expects the units to have been previously recognized and tagged with the ifcx_unit_tag() function. It will return roseunit_unknown if the units have not been tagged or if the unit described by the data object was not recognized.