shp文件转换到CAD dwg,dxf

本文介绍了一个使用Visual Basic编写的程序,该程序可以将地理信息系统(GIS)中的Features数据转换为CAD格式文件。此过程涉及使用ESRI ArcGIS Geoprocessor组件来执行转换,并提供了错误处理机制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 ''' <summary>
    ''' Features 转换到CAD文件
    ''' </summary>
    ''' <param name="in_features">输入文件路径</param>
    ''' <param name="Output_File">输出文件路径</param>
    ''' <param name="Output_Type">输出类型</param>
    ''' <param name="Ignore_FileNames"></param>
    ''' <remarks></remarks>
    Public Sub feature2CAD(ByVal in_features As String, ByVal Output_File As String, Optional ByRef Ignore_FileNames As Boolean = True)

        Try
            Dim gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor()
            Dim pExptoCAD As ExportCAD = New ExportCAD()

            pExptoCAD.in_features = in_features


            pExptoCAD.Output_File = Output_File
            pExptoCAD.Output_Type = "DWG_R2004" 

 

           pExptoCAD.Append_To_Existing = True
            pExptoCAD.Ignore_FileNames = True

            Dim result As IGeoProcessorResult
            result = gp.Execute(pExptoCAD, Nothing)


            If result Is Nothing Then
                MsgBox("转换失败,请检查参数是否正确!")
            Else
                If result.Status = esriJobStatus.esriJobSucceeded Then
                    MsgBox("文件生成成功!")
                End If
            End If

        Catch ex As Exception
            MsgBox(ex.Message + "转换失败,请检查参数是否正确!")
        End Try
    End Sub

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值