示例#1
0
		protected virtual IfcMaterialSelect GetMaterialSelect()
		{
			List<IfcRelAssociates> has = HasAssociations;
			foreach (IfcRelAssociates ra in has)
			{
				IfcRelAssociatesMaterial rm = ra as IfcRelAssociatesMaterial;
				if (rm != null)
					return rm.RelatingMaterial;
			}
			return null;
		}
示例#2
0
 protected virtual IfcMaterialSelect GetMaterialSelect()
 {
     foreach (IfcRelAssociates ra in HasAssociations)
     {
         IfcRelAssociatesMaterial rm = ra as IfcRelAssociatesMaterial;
         if (rm != null)
         {
             return(rm.RelatingMaterial);
         }
     }
     return(null);
 }
示例#3
0
        internal IfcMaterialLayerSet detectMaterialLayerSet()
        {
            IfcRelAssociatesMaterial associates = RelatedMaterialAssociation;

            if (associates == null)
            {
                return(null);
            }
            IfcMaterialSelect   material         = associates.RelatingMaterial;
            IfcMaterialLayerSet materialLayerSet = material as IfcMaterialLayerSet;

            if (materialLayerSet != null)
            {
                return(materialLayerSet);
            }
            IfcMaterialLayerSetUsage materialLayerSetUsage = material as IfcMaterialLayerSetUsage;

            if (materialLayerSetUsage != null)
            {
                return(materialLayerSetUsage.ForLayerSet);
            }
            return(null);
        }
示例#4
0
        internal void setMaterial(IfcMaterialSelect material)
        {
            IfcMaterialSelect m = material;

            if (mDatabase.mRelease == ReleaseVersion.IFC2x3)
            {
                IfcMaterialProfile profile = material as IfcMaterialProfile;
                if (profile != null)
                {
                    m = profile.Material;
                    mMaterialSelectIFC4 = profile;
                    IfcProfileDef pd = profile.Profile;
                    if (pd != null)
                    {
                        if (pd.mHasProperties.Count == 0)
                        {
                            IfcProfileProperties pp = new IfcProfileProperties(pd.Name, pd);
                            pp.mAssociates.addRelated(this);
                        }
                        else
                        {
                            pd.mHasProperties[0].mAssociates.addRelated(this);
                        }
                    }
                }
                else
                {
                    IfcMaterialProfileSet profileSet = material as IfcMaterialProfileSet;
                    if (profileSet == null)
                    {
                        IfcMaterialProfileSetUsage profileSetUsage = material as IfcMaterialProfileSetUsage;
                        if (profileSetUsage != null)
                        {
                            profileSet = profileSetUsage.ForProfileSet;
                        }
                    }
                    if (profileSet != null)
                    {
                        m = profileSet.PrimaryMaterial;
                        mMaterialSelectIFC4 = profileSet;
                        foreach (IfcMaterialProfile matp in profileSet.MaterialProfiles)
                        {
                            IfcProfileDef pd = matp.Profile;
                            if (pd != null)
                            {
                                if (pd.mHasProperties.Count == 0)
                                {
                                    IfcProfileProperties pp = new IfcProfileProperties(pd.Name, null, pd);
                                }
                                pd.mHasProperties[0].mAssociates.addRelated(this);
                            }
                        }
                    }
                    else
                    {
                        //constituentset....
                    }
                }
            }
            for (int icounter = 0; icounter < mHasAssociations.Count; icounter++)
            {
                IfcRelAssociatesMaterial rm = mHasAssociations[icounter] as IfcRelAssociatesMaterial;
                if (rm != null)
                {
                    rm.unassign(this);
                }
            }
            if (m != null)
            {
                m.Associates.addRelated(this);
            }
        }
示例#5
0
		internal static IfcRelAssociatesMaterial Parse(string strDef)
		{
			IfcRelAssociatesMaterial a = new IfcRelAssociatesMaterial();
			int pos = 0;
			a.parseString(strDef, ref pos);
			a.mRelatingMaterial = ParserSTEP.StripLink(strDef, ref pos);
			return a;
		}
示例#6
0
		internal IfcRelAssociatesMaterial(IfcRelAssociatesMaterial i) : base(i) { mRelatingMaterial = i.mRelatingMaterial; }
示例#7
0
		protected IfcMaterialUsageDefinition(DatabaseIfc m) : base(m) { IfcRelAssociatesMaterial am = new IfcRelAssociatesMaterial(this); }