示例#1
0
        /// <summary>
        /// Create a DirectShapeType.
        /// </summary>
        /// <param name="doc">The document.</param>
        /// <param name="name">The name of the DirectShapeType.</param>
        /// <param name="categoryId">The category of the DirectShape.</param>
        /// <param name="id">The id of the IFCEntity object creating the DirectShape.</param>
        /// <returns>The DirectShape.</returns>
        static public DirectShapeType CreateElementType(Document doc, string name, ElementId categoryId, int id)
        {
            DirectShapeType directShapeType = DirectShapeType.Create(doc, name, IFCElementUtil.GetDSValidCategoryId(doc, categoryId, id));

            Importer.TheCache.CreatedDirectShapeTypes[id] = directShapeType.Id;
            return(directShapeType);
        }
示例#2
0
        /// <summary>
        /// Create a DirectShapeType.
        /// </summary>
        /// <param name="doc">The document.</param>
        /// <param name="name">The name of the DirectShapeType.</param>
        /// <param name="categoryId">The category of the DirectShape.</param>
        /// <param name="id">The id of the IFCEntity object creating the DirectShape.</param>
        /// <param name="guid">The guid of the IFCEntity object creating the DirectShape.</param>
        /// <returns>The DirectShape.</returns>
        static public DirectShapeType CreateElementType(Document doc, string name, ElementId categoryId, int id, string guid, IFCEntityType entityType)
        {
            DirectShapeTypeOptions options = new DirectShapeTypeOptions();

            options.AllowDuplicateNames = true;
            ElementId       validCategoryId = IFCElementUtil.GetDSValidCategoryId(doc, categoryId, id);
            DirectShapeType directShapeType = DirectShapeType.Create(doc, name, validCategoryId, options);

            Importer.TheCache.CreatedDirectShapeTypes[id] = directShapeType.Id;

            Importer.TheProcessor.CreateElementType(id, guid, entityType.ToString(), validCategoryId.IntegerValue);

            return(directShapeType);
        }