Page 1 of 1

Selection bounding box

Posted: 18 Feb 2015, 17:21
by blueray
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

Re: Selection bounding box

Posted: 18 Feb 2015, 20:49
by support
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

Re: Selection bounding box

Posted: 20 Feb 2015, 12:04
by blueray
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

Re: Selection bounding box

Posted: 25 Feb 2015, 18:40
by support
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