How to get all the entities for a Layout
Moderators: SDS, support, admin
How to get all the entities for a Layout
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
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

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 (129.28 KiB) Viewed 22720 times
Re: How to get all the entities for a Layout
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:
Sergey.
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];
}
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to get all the entities for a Layout
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
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
Re: How to get all the entities for a Layout
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.
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
Chat support on Skype: cadsofttools.support
Re: How to get all the entities for a Layout
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
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
Re: How to get all the entities for a Layout
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.
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
Chat support on Skype: cadsofttools.support