internal IfcBuildingElementProxy(DatabaseIfc db, IfcBuildingElementProxy p, DuplicateOptions options) : base(db, p, options) { mPredefinedType = p.mPredefinedType; }
internal static IfcElement constructElement(string className, IfcProduct container, IfcObjectPlacement pl, IfcProductRepresentation r, IfcDistributionSystem system) { string str = className, definedType = ""; if (!string.IsNullOrEmpty(str)) { string[] fields = str.Split(".".ToCharArray()); if (fields.Length > 1) { str = fields[0]; definedType = fields[1]; } } IfcElement element = null; Type type = Type.GetType("GeometryGym.Ifc." + str); if (type != null) { ConstructorInfo ctor = type.GetConstructor(new[] { typeof(IfcProduct), typeof(IfcObjectPlacement), typeof(IfcProductRepresentation) }); if (ctor == null) { ctor = type.GetConstructor(new[] { typeof(IfcProduct), typeof(IfcObjectPlacement), typeof(IfcProductRepresentation), typeof(IfcDistributionSystem) }); if (ctor == null) throw new Exception("XXX Unrecognized Ifc Constructor for " + className); else element = ctor.Invoke(new object[] { container, pl, r, system }) as IfcElement; } else element = ctor.Invoke(new object[] { container, pl, r }) as IfcElement; } if (element == null) element = new IfcBuildingElementProxy(container, pl, r); if (!string.IsNullOrEmpty(definedType)) { if (container.mDatabase.mSchema == Schema.IFC2x3) element.ObjectType = definedType; else { type = element.GetType(); PropertyInfo pi = type.GetProperty("PredefinedType"); if (pi != null) { Type enumType = Type.GetType("GeometryGym.Ifc." + type.Name + "TypeEnum"); if (enumType != null) { FieldInfo fi = enumType.GetField(definedType); if (fi == null) { element.ObjectType = definedType; fi = enumType.GetField("NOTDEFINED"); } if (fi != null) { int i = (int)fi.GetValue(enumType); object newEnumValue = Enum.ToObject(enumType, i); pi.SetValue(element, newEnumValue, null); } else element.ObjectType = definedType; } else element.ObjectType = definedType; } else element.ObjectType = definedType; } } return element; }
internal IfcBuildingElementProxy(DatabaseIfc db, IfcBuildingElementProxy p, IfcOwnerHistory ownerHistory, bool downStream) : base(db, p, ownerHistory, downStream) { mPredefinedType = p.mPredefinedType; }
public Pset_ConcreteElementGeneral(IfcBuildingElementProxy instance) : base(instance.mDatabase, "Pset_ConcreteElementGeneral") { Description = instance.Name; DefinesOccurrence.Assign(instance); }
internal static IfcBuildingElementProxy Parse(string strDef) { IfcBuildingElementProxy p = new IfcBuildingElementProxy(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; }
internal static void parseFields(IfcBuildingElementProxy p, List<string> arrFields, ref int ipos) { IfcBuildingElement.parseFields(p, arrFields, ref ipos); string str = arrFields[ipos++]; if (str.StartsWith(".")) { try { p.mPredefinedType = (IfcBuildingElementProxyTypeEnum)Enum.Parse(typeof(IfcBuildingElementProxyTypeEnum), str.Replace(".", "")); } catch (Exception) { } } }
internal IfcBuildingElementProxy(IfcBuildingElementProxy p) : base(p) { mPredefinedType = p.mPredefinedType; }
internal static IfcBuildingElementProxy Parse(string str) { IfcBuildingElementProxy p = new IfcBuildingElementProxy(); int pos = 0; p.Parse(str, ref pos, str.Length); return p; }
internal IfcBuildingElementProxy(DatabaseIfc db, IfcBuildingElementProxy p) : base(db, p) { mPredefinedType = p.mPredefinedType; }