Using SelectExt in non-"Model" layout

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
thomascheah
Posts: 26
Joined: 17 Oct 2007, 06:46
Location: Malaysia
Contact:

Using SelectExt in non-"Model" layout

Post by thomascheah » 12 Feb 2008, 13:26

Does anybody notice that SelectExt method does not work on other layouts except the default Model layout. When I open a CAD file using the CAD Import Viewer with Model layout selected, I can use the Selection tool to select the entities in the CAD file. But when other layout is selected, no entities can be selected using the Selection tool.

I am not sure whether this is a bug or an intentional behavior? If it is intentional, I wonder what is the rationale behind it as it does not make any sense to me.

Does anyone encounter this before or has any idea about this? Thanks!

<b>Objective World Pvt. Ltd.</b>
"<i>Turning Knowledge Into Wisdom.</i>"
http://www.objectiveworld.com

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

Post by support » 12 Feb 2008, 16:03

Hi!

Method SelectExt works no matter whether model or any layout is selected. The following code demonstrates it:
<ol type="1">
<li>Put a listBox on the form of Viewer demo.</li>
<li>Add the following code in to cadPictBox_MouseUp:

Code: Select all

<font color="blue">private void</font id="blue"> cadPictBox_MouseUp(<font color="blue">object</font id="blue"> sender, System.Windows.Forms.MouseEventArgs e)
{
...			
	<font color="blue">this</font id="blue">.cadImage.UseDoubleBuffering = <font color="blue">false</font id="blue">;
	<font color="blue">this</font id="blue">.cadImage.SelectionMode = CADImport.SelectionEntityMode.Enabled;
	CADEntity ent = (CADEntity) <font color="blue">this</font id="blue">.cadImage.SelectExt(e.X,e.Y, <font color="blue">true</font id="blue">,<font color="blue">true</font id="blue">);	
	<font color="blue">if</font id="blue"> (ent != <font color="blue">null</font id="blue">)
	{
		listBox1.Items.Clear();
		listBox1.Items.Add(ent.EntName);
	}
	cadPictBox.Invalidate();
...
</li></ol id="1">
Sergey.

Please post questions to the forum or write to support@cadsofttools.com

thomascheah
Posts: 26
Joined: 17 Oct 2007, 06:46
Location: Malaysia
Contact:

Post by thomascheah » 12 Feb 2008, 17:11

Hi Sergey,

Thanks for your quick response. Had tried amending the Viewer with your code above. Unfortunately, no luck at all. I had emailed you earlier a DXF file for verfiying this problem yourself. I am going to email you another DXF file that is VERY VERY basic but with multiple layouts. You will notice that the SelectExt works normally in Model layout, but not other layouts.

<b>Objective World Pvt. Ltd.</b>
"<i>Turning Knowledge Into Wisdom.</i>"
http://www.objectiveworld.com

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

Post by support » 13 Feb 2008, 14:57

Hi Thomas,

We tested your files. Both of them contain ViewPorts on layouts. That is why non of entities can be selected except ViewPort itself. AutoCAD does the same.

Sergey

Please post questions to the forum or write to support@cadsofttools.com

Post Reply