Esempio n. 1
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);

            if (options.Style != SetJsonOptions.JsonStyle.Repository)
            {
                obj["RelatedElements"] = new JArray(RelatedElements.Select(x => x.getJson(this, options)));
            }
        }
Esempio n. 2
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$");
            parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$");
            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(RelatedElements != null ? RelatedElements.ToStepValue() : "$");
            parameters.Add(RelatingStructure != null ? RelatingStructure.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Esempio n. 3
0
        /// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcRelReferencedInSpatialStructureClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcRelReferencedInSpatialStructureClause.WR31:
                    retVal = Functions.SIZEOF(RelatedElements.Where(temp => Functions.TYPEOF(temp).Contains("IFC4.IFCSPATIALSTRUCTUREELEMENT"))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.ProductExtension.IfcRelReferencedInSpatialStructure>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcRelReferencedInSpatialStructure.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
Esempio n. 4
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "RelatingStructure") == 0)
         {
             RelatingStructure = mDatabase.ParseXml <IfcSpatialElement>(child as XmlElement);
         }
         else if (string.Compare(name, "RelatedElements") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcProduct p = mDatabase.ParseXml <IfcProduct>(cn as XmlElement);
                 if (p != null)
                 {
                     RelatedElements.Add(p);
                 }
             }
         }
     }
 }
Esempio n. 5
0
 internal override void parseJObject(JObject obj)
 {
     base.parseJObject(obj);
     RelatedElements.AddRange(mDatabase.extractJArray <IfcProduct>(obj.GetValue("RelatedElements", StringComparison.InvariantCultureIgnoreCase) as JArray));
 }