internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary) { mName = ParserSTEP.StripString(str, ref pos, len); mDescription = ParserSTEP.StripString(str, ref pos, len); MaterialProfiles.AddRange(ParserSTEP.StripListLink(str, ref pos, len).ConvertAll(x => dictionary[x] as IfcMaterialProfile)); CompositeProfile = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcCompositeProfileDef; }
internal override void parseJObject(JObject obj) { base.parseJObject(obj); Name = extractString(obj.GetValue("Name", StringComparison.InvariantCultureIgnoreCase)); Description = extractString(obj.GetValue("Description", StringComparison.InvariantCultureIgnoreCase)); JArray array = obj.GetValue("MaterialProfiles") as JArray; if (array != null) { foreach (JObject o in array) { IfcMaterialProfile mp = mDatabase.ParseJObject <IfcMaterialProfile>(o); if (mp != null) { MaterialProfiles.Add(mp); } } } JObject jobj = obj.GetValue("CompositeProfile", StringComparison.InvariantCultureIgnoreCase) as JObject; if (jobj != null) { CompositeProfile = mDatabase.ParseJObject <IfcCompositeProfileDef>(jobj); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); setAttribute(obj, "Name", Name); setAttribute(obj, "Description", Description); obj["MaterialProfiles"] = new JArray(MaterialProfiles.ConvertAll(x => x.getJson(this, options))); if (mCompositeProfile != null) { obj["CompositeProfile"] = CompositeProfile.getJson(this, options); } }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(MaterialProfiles != null ? MaterialProfiles.ToStepValue() : "$"); parameters.Add(CompositeProfile != null ? CompositeProfile.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }