0

I'd like to draw the bounding box of a selected entity. I can have it done by drawing line by line, however, I see it offer the BoundingBox but I cannot get it to work. I am not sure how it can add the box to theModel so it can be drawn.

 theModel.SelectionChanged += (s, e) =>
             {
                 foreach(var selecteditem in e.AddedItems)
                     if(selecteditem.Item is Entity entity)
                         selectedEntities.Add(entity);

                 foreach (var selecteditem in e.RemovedItems)
                     if (selecteditem.Item is Entity entity)
                         selectedEntities.Remove(entity);

                 foreach(var ent in selectedEntities)
                 {
                     if(ent is Brep brep)
                     {
                         brep = (Brep)ent;
                        var box = new BoundingBox(font, 6666, true, false, brep.BoxMin, brep.BoxMax);
                     }
                 }
                 
                 theModel.Invalidate();
            
             };
squillman
  • 13,363
  • 3
  • 41
  • 60
N.TW12
  • 241
  • 2
  • 11

1 Answers1

1

The BoundingBox class is designed only for the Model's bounding box settings.

ilCosmico
  • 1,319
  • 15
  • 26
  • Thanks and it makes sense and there are not many use cases that we need to turn on bounding box for every entity. – N.TW12 Nov 13 '20 at 14:53