Exemple #1
0
        public RoomProperties(Room room, RevitLinkProperties link)
        {
            roomElement    = room;
            roomId         = room.Id;
            uniqueId       = room.UniqueId;
            ifcGuid        = room.IfcGUID();
            ifcProjectGuid = link.IfcProjectGuid;
            transformValue = link.TransformValue;
            isLinked       = link.IsLinked;
            roomNumber     = room.Number;
            roomName       = room.Name;

            //roomSolid = GetRoomSolid();
        }
        public RevitComponent(Schemas.Component component, Element element, RevitLinkProperties link)
        {
            try
            {
                Action            = component.Action;
                AuthoringToolId   = component.AuthoringToolId;
                Color             = component.Color;
                ElementName       = component.ElementName;
                Guid              = component.Guid;
                IfcGuid           = component.IfcGuid;
                OriginatingSystem = component.OriginatingSystem;
                Responsibility    = component.Responsibility;
                Selected          = component.Selected;
                ViewPointGuid     = component.ViewPointGuid;
                Visible           = component.Visible;

                RvtElement     = element;
                ElementId      = element.Id;
                IfcProjectGuid = link.IfcProjectGuid;
                TransformValue = link.TransformValue;
                IsLinked       = link.IsLinked;
                ElementName    = element.Name;
                Category       = new CategoryProperties(element.Category);

                var typeId      = element.GetTypeId();
                var elementType = link.LinkedDocument.GetElement(typeId) as ElementType;
                if (null != elementType)
                {
                    PreviewImage = elementType.GetPreviewImage(new Size(48, 48));
                }
            }
            catch (Exception)
            {
                // ignored
            }
        }
Exemple #3
0
        public RevitComponent(HOK.SmartBCF.Schemas.Component component, Element element, RevitLinkProperties link)
        {
            try
            {
                this.Action            = component.Action;
                this.AuthoringToolId   = component.AuthoringToolId;
                this.Color             = component.Color;
                this.ElementName       = component.ElementName;
                this.Guid              = component.Guid;
                this.IfcGuid           = component.IfcGuid;
                this.OriginatingSystem = component.OriginatingSystem;
                this.Responsibility    = component.Responsibility;
                this.Selected          = component.Selected;
                this.ViewPointGuid     = component.ViewPointGuid;
                this.Visible           = component.Visible;

                this.RvtElement     = element;
                this.ElementId      = element.Id;
                this.IfcProjectGuid = link.IfcProjectGuid;
                this.TransformValue = link.TransformValue;
                this.IsLinked       = link.IsLinked;
                this.ElementName    = element.Name;
                this.Category       = new CategoryProperties(element.Category);

                ElementId   typeId      = element.GetTypeId();
                ElementType elementType = link.LinkedDocument.GetElement(typeId) as ElementType;
                if (null != elementType)
                {
                    this.PreviewImage = elementType.GetPreviewImage(new Size(48, 48));
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
        }