Selection bounding box

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
blueray
Posts: 3
Joined: 18 Feb 2015, 15:38

Selection bounding box

Post by blueray » 18 Feb 2015, 17:21

Hello,

When selecting a block entity, there is a bounding rectangle drawn around the selected entity. Is it possible to just highlight the entity with dashed pattern, without drawing the bounding selection rectangle?
Also, when selecting a line entity, the line is highlighted with dash pattern, but it looks like there also is a really thin bounding rectangle through the line?

Many thanks.
Tomas

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Selection bounding box

Post by support » 18 Feb 2015, 20:49

Hello Tomas,

You can highlight some entity with the dash pattern by changing its line type (CADEntity.LineType). The line types are stored in the CADConverter, so there are two ways to get a line type:

1) Load a line type by its name from a drawing file:

Code: Select all

using CADImport;
...

CADLineType LType = cadImage.Converter.LTypeByName("ISO dash"); 
2) Create a new line type using the following code:

Code: Select all

using CADImport;
...

CADLineType LType = new CADLineType();
LType.Name = "ISO dash";
LType.Lines.Initialize(new double[] { 1.2, -0.9 });
cadImage.Converter.Loads(LType);
cadImage.Converter.GetSection(FaceModule.ConvSection.LTypes).AddEntity(LType); 
then read it from the Converter as described in the p. 1.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

blueray
Posts: 3
Joined: 18 Feb 2015, 15:38

Re: Selection bounding box

Post by blueray » 20 Feb 2015, 12:04

Hi Mikhail,

Thank you very much, that seems doable.

One more question:
When doing multi select with a mouse rectangle:

Code: Select all

cadImage.SelectionMode = SelectionEntityMode.Enabled;
cadImage.MultipleSelect(rect, true, true);
those entities are selected, which lie completely in the rectangle. Is it possible to select entities which lie only partially in the rectangle ? (I.e. also select a line, which has one half inside selection rect, and other half outside).

One more question: In the setup stage, there is this one static method setup:

Code: Select all

ObjEntity.cadImage = cadImage;
Does this mean it is possible to have just one instance of a viewer control in the application?

Thank you very much,
Tomas

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Selection bounding box

Post by support » 25 Feb 2015, 18:40

blueray wrote: Is it possible to select entities which lie only partially in the rectangle ? (I.e. also select a line, which has one half inside selection rect, and other half outside).
It isn't possible to select entities which lie only partially in the selection rectangle.

The ObjEntity class is intended for displaying the entity properties in the PropertyGrid control. You may have several CADImage instances in the application.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply