26
Puntos
Preguntas
1
Respuestas
1
Ya he visto donde esta el problema. Había intentado usar GetUnitFor para que IfcUnitAssignment devolviera la unit de la propiedad pero me devolvía null, ya que usaba la interface. Si se utiliza según el esquema IFC, devuelve el unit correspondiente:
switch (propertyX.SchemaVersion)
{
case Xbim.Common.Step21.XbimSchemaVersion.Ifc2X3:
var UnitAssig2x3 = (Xbim.Ifc2x3.MeasureResource.IfcUnitAssignment)UnitAssigment;
var UnitExist2x3 = UnitAssig2x3.GetUnitFor(propertyX.IfcProperty as Xbim.Ifc2x3.PropertyResource.IfcPropertySingleValue);
unitX = UnitExist2x3 as IIfcNamedUnit;
break;case Xbim.Common.Step21.XbimSchemaVersion.Ifc4:
case Xbim.Common.Step21.XbimSchemaVersion.Ifc4x1:
var UnitAssig4 = (Xbim.Ifc4.MeasureResource.IfcUnitAssignment)UnitAssigment;
var UnitExist4 = UnitAssig4.GetUnitFor(propertyX.IfcProperty as Xbim.Ifc4.PropertyResource.IfcPropertySingleValue);
unitX = UnitExist4 as IIfcNamedUnit;
break;case Xbim.Common.Step21.XbimSchemaVersion.Unsupported:
unitX = null;
break;
}Esta respuesta fue aceptada por Ivan. on enero 19, 2020 Ganaste 15 puntos.
- 2163 vistas
- 1 resp
- 0 votos
