Exemplo n.º 1
0
        void ReconstructElementTypeDuplicate
        (
            DB.Document doc,
            ref DB.ElementType elementType,

            DB.ElementType type,
            string name
        )
        {
            if
            (
                elementType is DB.ElementType &&
                elementType.Category.Id == type.Category.Id &&
                elementType.FamilyName == type.FamilyName &&
                elementType.GetType() == type.GetType()
            )
            {
                if (elementType.Name != name)
                {
                    elementType.Name = name;
                }

                if (elementType is DB.HostObjAttributes hostElementType && type is DB.HostObjAttributes hostType)
                {
                    hostElementType.SetCompoundStructure(hostType.GetCompoundStructure());
                }

                elementType.CopyParametersFrom(type);
            }
            else
            {
                elementType = type.Duplicate(name);
            }
        }
Exemplo n.º 2
0
        void ReconstructElementTypeDuplicate
        (
            Document doc,
            ref Autodesk.Revit.DB.ElementType elementType,

            Autodesk.Revit.DB.ElementType type,
            string name
        )
        {
            ReplaceElement(ref elementType, type.Duplicate(name));
        }
Exemplo n.º 3
0
        void ReconstructElementTypeDuplicate
        (
            DB.Document doc,
            ref DB.ElementType elementType,

            DB.ElementType type,
            string name
        )
        {
            ReplaceElement(ref elementType, type.Duplicate(name));
        }