DXF Import&Layer select

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Willi
Posts: 1
Joined: 13 Nov 2006, 23:31

DXF Import&Layer select

Post by Willi » 13 Nov 2006, 23:40

Hello,

I want to import an DXF-drawing, change the layers and print the whole drawing automatically by VB.net.
Now I don't know how to use the layer selection procedure in VB.NET (and the import procedure). I think I don't need to view the drawing.

Can someone help me with some code in VB.net?
I think, the easiest way would be to use the "CAD Import .NET for Compact Framework" or the "CAD Import.NET".

Any suggestions are welcome.

BR
Willi

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

Post by support » 14 Nov 2006, 14:30

Hello Willi,

There are two ways to switch off or on a necessary layer:

<ul><li>Basing on the <b>Viewer</b> demo (please find it in the ..\cadimportnet\sources\Viewer\VB\.. folder of the package):

use the following method:

Code: Select all

FCADImage.SetLayerVisible(Index, val)
<i>Index</i>
  An index of the layer in the collection of layers. 
<i>val</i> 
  A value which the specified layer's visibility will be set to. 
</li>
<li>Basing on the <b>Import</b> demo (please find it in the ..\cadimportnet\sources\Import\VB\.. folder):

Code: Select all

CADLayer L1= FCADImage.Converter. LayerByName("Layer1")
L1.Visible = <font color="blue">false</font id="blue">

Public Function FCADImage.Converter.LayerByName(<font color="blue">ByVal</font id="blue"> AName <font color="blue">As String</font id="blue">)  <font color="blue">As</font id="blue"> CADLayer
<b>Parameters</b>
<i>AName </i>
  A name of the layer to return.</li></ul>

For getting a list of layers' names use the following methiod:

Code: Select all

Public Sub FCADImage.Converter.GetLayerNames(<font color="blue">ByVal</font id="blue"> S <font color="blue">As</font id="blue"> ArrayList, <font color="blue">ByVal</font id="blue"> DoClear <font color="blue">As Boolean</font id="blue">, <font color="blue">ByVal</font id="blue"> IncludeUnused <font color="blue">As Boolean</font id="blue">)
<i>S </i>
  An ArrayList where the layers' names will be added. 
<i>DoClear</i> 
  A value indicating whether to clear the specified ArrayList before adding the layers' names to it. 
<i>IncludeUnused</i> 
  A value indicating whether to include the names of layers that don't contain any entities. 
Sergey.

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

Post Reply