AutoCAD like selection style

Was this article helpful?
1 out of 1 found this helpful


Date Votes
  • I follow this help, but i have and problem, can you help me.

  • Hello, can you help me how to use this one in eyeshot 2020, i think that code is error.


    //IList<Entity> myEnts = Entities.CurrentBlockReference != null
                    //    ? Blocks[Entities.CurrentBlockReference.BlockName].Entities
                    //    : new List<Entity>(Entities);
  • You can replace the code snippet with the following:

    EntityList myEnts = CurrentBlockReference != null
    ? Blocks[CurrentBlockReference.BlockName].Entities
    : Entities;


  • I tried this but I am having the same issue as NGUYEN PHUONG LAM. The selections work, but the selection preview rectangle is shifted down by as shown in the gif above. Also, this only happens when displaying on laptop. When docked, the rectangles display correctly.

  • Are you using a Text scaling different from 100% on the non-docked laptop?

  • Are you referring to windows display scaling? Mine is set to 125%. Is there a way to adjust for this?

  • Hi Timothy,

    we discussed this topic by ticket, but for future readers:

    In a previous version of the sample, MyDesign.DrawSelectionBox used to use ActualWidth/ActualHeight;
    however, one can now directly use the Size property instead of ActualWidth/ActualHeight properties in order to show the correct size, because it already considers the dpi scaling level:

    void DrawSelectionBox(System.Drawing.Point p1, System.Drawing.Point p2, Color transparentColor, bool drawBorder, bool dottedBorder)
    //p1.Y = (int)(ActualHeight - p1.Y);
    //p2.Y = (int)(ActualHeight - p2.Y);
    p1.Y = (int)(Size.Height - p1.Y);
    p2.Y = (int)(Size.Height - p2.Y);

    // ...

Please sign in to leave a comment.

Articles in this section