[Visual Basic 6.0]Public Sub CadLayer()
'Set the Workspace Factory
Dim pWorkspaceFact As IWorkspaceFactory
Set pWorkspaceFact = New CadWorkspaceFactory'Open the Workspace
Dim pWorkspace As IWorkspace
Set pWorkspace = pWorkspaceFact.OpenFromFile("c:\data", 0)'Set the CadDrawingWorkspace
Dim pCadDwgWorkspace As ICadDrawingWorkspace
Set pCadDwgWorkspace = pWorkspace'Open the CadDrawingDataset
Dim pCadDwgDataset As ICadDrawingDataset
Set pCadDwgDataset = pCadDwgWorkspace.OpenCadDrawingDataset("PARCELS.DWG")
'Create the CadLayer
Dim pCadLayer As ICadLayer
Set pCadLayer = New CadLayer'Set the CadLayer to the CadDrawingDatsaset
Set pCadLayer.CadDrawingDataset = pCadDwgDataset
'List the CadLayer FilePath
Debug.Print "CAD Drawing Path: " & pCadLayer.FilePath
'List if the CadLayer is 2d
Debug.Print "Is Drawing 2d?: " & pCadLayer.Is2d
'List if the CadLayer is 3d
Debug.Print "Is Drawing 3d?: " & pCadLayer.Is3d
'List if the CadLayer is an AutoCAD drawing file
Debug.Print "Is Drawing from AutoCAD?: " & pCadLayer.IsAutoCad
'List if the CadLayer is an MicroSation drawing file
Debug.Print "Is Drawing from MicroStation?: " & pCadLayer.IsDgn
End Sub
[Visual Basic .NET, C#, C++]
No example is available for Visual Basic .NET, C#, or C++. To view a Visual Basic 6.0 example, click the Language Filter button
in the upper-left corner of the page.