public override bool ShouldDisplay(ObjectPropertiesPageEventArgs e)
        {
            if (!e.Objects.Any())
            {
                return(false);
            }

            //check if a subsurface is selected.
            var selectedObj        = e.Objects.Last();
            var subObjes           = selectedObj.GetSelectedSubObjects();
            var isSelectedBrepFace = null != subObjes;

            if (isSelectedBrepFace)
            {
                var comIndex = subObjes.Last();
                if (comIndex.ComponentIndexType != Rhino.Geometry.ComponentIndexType.BrepFace)
                {
                    return(false);
                }

                var faceIndex      = comIndex.Index;
                var hostRoomObjRef = new ObjRef(selectedObj.Id);
                this._HBObjEntity = hostRoomObjRef.TryGetFaceEntity(comIndex);
                return(this._HBObjEntity.IsValid);
            }
            return(false);
        }
        public override bool ShouldDisplay(ObjectPropertiesPageEventArgs e)
        {
            if (!e.Objects.Any())
            {
                return(false);
            }
            //if (e.ObjectCount !=1) return false;
            if (e.Objects.Count() != 1)
            {
                return(false);
            }

            var obj = e.Objects.Last();
            var ent = obj.Geometry.TryGetShadeEntity();

            this._HBObjEntity = ent;
            return(this._HBObjEntity.IsValid);
        }
예제 #3
0
        public override bool ShouldDisplay(ObjectPropertiesPageEventArgs e)
        {
            //reset
            _HBObjEntity = new RoomEntity();
            if (!e.Objects.Any())
            {
                return(false);
            }

            var roomEnts = e.Objects.Where(_ => _.Geometry.TryGetRoomEntity().IsValid);

            if (!roomEnts.Any())
            {
                return(false);
            }

            //var isApertureOnly = e.Objects.Count() == 1 && e.Objects[0].Geometry.TryGetApertureEntity().IsValid;
            //if (isApertureOnly)
            //    return false;

            this._HBObjEntity = roomEnts.First().Geometry.TryGetRoomEntity();
            return(this._HBObjEntity.IsValid);
        }