100不够可以再加。

解决方案 »

  1.   

    这个问题不小啊,你是搞GIS的吗?用来干什么的?
    一起期待高手,:)
      

  2.   

    一‘读DXF文件
    ' ReadDXF extracts specified code/value pairs from a DXF file.
    ' This function requires four string parameters, a valid DXF
    ' file name, a DXF section name, the name of an object in that
    ' section, and a comma delimited list of codes.
    '
    function ReadDXF( _
            ByVal dxfFile As String, ByVal strSection As String, _
            ByVal strObject As String, ByVal strCodeList As String)
        Dim tmpCode, lastObj As String
        Open dxfFile For Input As #1
        ' Get the first code/value pair
        codes = ReadCodes
        ' Loop through the whole file until the "EOF" line
        While codes(1) <> "EOF"
            ' If the group code is '0' and the value is 'SECTION' ..
            If codes(0) = "0" And codes(1) = "SECTION" Then
                ' This must be a new section, so get the next
                ' code/value pair.
                codes = ReadCodes()
                ' If this section is the right one ..
                If codes(1) = strSection Then
                    ' Get the next code/value pair and ..
                    codes = ReadCodes
                    ' Loop through this section until the 'ENDSEC'
                    While codes(1) <> "ENDSEC"
                        ' While in a section, all '0' codes indicate
                        ' an object. If you find a '0' store the
                        ' object name for future use.
                        If codes(0) = "0" Then lastObj = codes(1)
                        ' If this object is one you're interested in
                        If lastObj = strObject Then
                            ' Surround the code with commas
                            tmpCode = "," & codes(0) & ","
                            ' If this code is in the list of codes ..
                            If InStr(strCodeList, tmpCode) Then
                                ' Append the return value.
                                ReadDXF = ReadDXF & _
                                    codes(0) & "=" & codes(1) & vbCrLf
                            End If
                        End If
                        ' Read another code/value pair
                        codes = ReadCodes
                    Wend
                End If
            Else
                codes = ReadCodes
            End If
        Wend
        Close #1
    End Function