GeometryGym.Ifc.IfcUnitAssignment.SetUnits C# (CSharp) Méthode

SetUnits() private méthode

private SetUnits ( ) : void
Résultat void
        internal void SetUnits()
        {
            if (Find(IfcUnitEnum.AREAUNIT) == null)
                mUnits.Add(mDatabase.Factory.SIArea.mIndex);
            if (Find(IfcUnitEnum.VOLUMEUNIT) == null)
                mUnits.Add(mDatabase.Factory.SIVolume.mIndex);
            if (Find(IfcUnitEnum.PLANEANGLEUNIT) == null)
            {
                IfcSIUnit radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN);
                mUnits.Add(mDatabase.Factory.Options.AngleUnitsInRadians ? radians.mIndex : new IfcConversionBasedUnit(IfcUnitEnum.PLANEANGLEUNIT, "DEGREE", new IfcMeasureWithUnit(new IfcPlaneAngleMeasure(Math.PI / 180.0), radians)).mIndex);
            }
            if (Find(IfcUnitEnum.TIMEUNIT) == null)
            {
                IfcSIUnit seconds = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND);
                if (mDatabase.mTimeInDays)
                {
                    IfcMeasureWithUnit mu = new IfcMeasureWithUnit(new IfcTimeMeasure(60 * 60 * 24), seconds);
                    mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.TIMEUNIT, "DAY", mu).mIndex);
                }
                else
                    mUnits.Add(seconds.mIndex);
            }
        }

Same methods

IfcUnitAssignment::SetUnits ( Length length ) : void

Usage Example

Exemple #1
0
		protected IfcContext(DatabaseIfc m, string name, IfcUnitAssignment.Length length) : base(m)
		{
			Name = name;
			if (m.mGeomRepContxt != null)
				mRepresentationContexts.Add(m.mGeomRepContxt.mIndex);
			IfcUnitAssignment u = new IfcUnitAssignment(m);
			u.SetUnits(length);
			mUnitsInContext = u.mIndex;
			mIsDecomposedBy.Clear(); //??? Jon
		}