How to exclude hidden layers when exporting PDF from DWG

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
dancefly09
Posts: 1
Joined: 17 May 2023, 10:36

How to exclude hidden layers when exporting PDF from DWG

Post by dancefly09 » 17 May 2023, 10:43

Some entities in the dwg file are scattered on different layers. I set one of the layers as a hidden attribute, and then exported this dwg file to PDF through cad.net. The generated PDF still presents the entities on the hidden layers. May I ask if there are any relevant options to control whether hidden layers are not exported when exporting PDF?

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

Re: How to exclude hidden layers when exporting PDF from DWG

Post by support » 23 May 2023, 11:00

Hello,

If a layer is frozen or invisible the CAD entities it contains will also be invisible. If a layer is invisible but not frozen and it contains inserts of blocks belonging to visible layers then those blocks will be visible.

Please use the code below:

if (cadImage != null)
{
foreach(CADLayer l in cadImage.Converter.Layers)
{
if (l.Name == "0") l.Visible = false;

}
}


Kind regards,
Suraya
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply