示例#1
0
        /// <summary>
        /// Returns the associated material id, if any.
        /// </summary>
        /// <param name="scope">The containing creation scope.</param>
        /// <returns>The element id of the material, if any.</returns>
        public virtual ElementId GetMaterialElementId(IFCImportShapeEditScope scope)
        {
            ElementId materialId = scope.GetCurrentMaterialId();

            if (materialId != ElementId.InvalidElementId)
            {
                return(materialId);
            }

            if (scope.Creator != null)
            {
                IFCMaterial creatorMaterial = scope.Creator.GetTheMaterial();
                if (creatorMaterial != null)
                {
                    return(creatorMaterial.GetMaterialElementId());
                }
            }

            return(ElementId.InvalidElementId);
        }