FUNCTION IfcCurveDim
(Curve : IfcCurve)
: IfcDimensionCount;
IF ('IFC4X3_DEV_20bdb3d.IFCLINE' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcLine.Pnt.Dim);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCCONIC' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcConic.Position.Dim);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCPOLYLINE' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcPolyline.Points[1].Dim);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCTRIMMEDCURVE' IN TYPEOF(Curve))
THEN RETURN(IfcCurveDim(Curve\IfcTrimmedCurve.BasisCurve));
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCGRADIENTCURVE' IN TYPEOF(Curve))
THEN RETURN(3);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCSEGMENTEDREFERENCECURVE' IN TYPEOF(Curve))
THEN RETURN(3);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCCOMPOSITECURVE' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcCompositeCurve.Segments[1].Dim);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCBSPLINECURVE' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcBSplineCurve.ControlPointsList[1].Dim);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCOFFSETCURVE2D' IN TYPEOF(Curve))
THEN RETURN(2);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCOFFSETCURVE3D' IN TYPEOF(Curve))
THEN RETURN(3);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCOFFSETCURVEBYDISTANCES' IN TYPEOF(Curve))
THEN RETURN(3);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCCURVESEGMENT2D' IN TYPEOF(Curve))
THEN RETURN(2);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCPOLYNOMIALCURVE' IN TYPEOF(Curve)) THEN
IF ( NOT EXISTS(Curve\IfcPolynomialCurve.CoefficientsZ) AND (Curve\IfcPolynomialCurve.Position.Dim = 2 ))
THEN RETURN(2);
END_IF;
RETURN(3);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCPCURVE' IN TYPEOF(Curve))
THEN RETURN(3);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCINDEXEDPOLYCURVE' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcIndexedPolyCurve.Points.Dim);
END_IF;
IF ('IFC4X3_DEV_20bdb3d.IFCSPIRAL' IN TYPEOF(Curve))
THEN RETURN(Curve\IfcSpiral.Position.Dim);
END_IF;
RETURN (?);
END_FUNCTION;