How to get all the entities for a Layout

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Serge
Posts: 4
Joined: 01 Aug 2008, 19:10

How to get all the entities for a Layout

Post by Serge » 22 Jan 2009, 22:49

Hello guys,

When I load the DWG, I got 5 layouts. For some reason the Entities collection for each of them except default is just 45. (For default is 29,000). When loading the same image in the demo view application, it loads correctly. The viewer shows all the items from the "Overal" layout and some entities from the default layout. When I hide all the entities in the viewer, only necessary items from the default layout are shown. Please, tell, how to get all the entities for the layout. The attachments shows my understanding of how to get them. It seems I'm wrong, but I cnnot find any additional explanation in the docs.

I'll really appreciate a code sample :) If in C#, i'll be more then happy.

FYI, I draw all the entities manually. I just need to know what entities to draw for the specified layout.

Thank you in advance,
Serge
Attachments
CADLayoutQuestion.jpg
CADLayoutQuestion.jpg (129.28 KiB) Viewed 22720 times

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

Re: How to get all the entities for a Layout

Post by support » 23 Jan 2009, 16:23

Hello Serge,

The situation when Layout contains another number of entities then Model is usual. Layout may contain as a Viewport (which shows a part or the whole Model sheet) and as its own entities. Entities from a Viewport are not transmitted to a Layout's entities' list.
The following code shows how to get access to all entities on all layouts:

Code: Select all

	if (this.cadImage == null)
		return;			
	CADEntity ent;
	for (int i=0;i<this.cadImage.Converter.LayoutsCount;i++)
	{				
		for (int j=0;j<this.cadImage.Converter.Layouts[i].Count;j++)
		{
			ent = this.cadImage.Converter.Layouts[i].Entities[j];
		}
	}
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Serge
Posts: 4
Joined: 01 Aug 2008, 19:10

Re: How to get all the entities for a Layout

Post by Serge » 23 Jan 2009, 16:52

Hello Sergey,

Thank you for a reply. How to get the Viewport parameters for a specific layout in the Model coordinates?
My file has just 2 viewports and 5 layouts. How to match them?

Thanks,
Serge

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

Re: How to get all the entities for a Layout

Post by support » 23 Jan 2009, 17:47

Hello Serge,

Viewport contains methods which just define how, where and what part of Model to be shown on a Layout. It does not give access to Model inner space. Can you please specify what exactly Viewport data you need to get and why?

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

Serge
Posts: 4
Joined: 01 Aug 2008, 19:10

Re: How to get all the entities for a Layout

Post by Serge » 23 Jan 2009, 19:00

I need the Width of the viewport to show only necessary items and cut the others (I got how to get CenterPoint, Height, TwistAngle).
I need to have a layouts to viewport (or vise versa) mapping to show the necessary part of the model by choosen layout.

Thanks,
Serge

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

Re: How to get all the entities for a Layout

Post by support » 26 Jan 2009, 10:25

Hello Serge,

The task is rather clear. Unfortunately this functionality is unavailable for the moment. This task requires detailed elaboration. It can not be solved "on the fly" as this might possibly harm other customers using CAD Import .NET. We can not say exactly how long it is going to take to study the problem.
Nevertheless we do thank you for your suggestion and your help. We'll inform you when the update is ready.

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

Post Reply