本帖最后由 tiancao100 于 2025-5-7 10:10 编辑
VB.net 读取天正建筑多行文字方法1~3
https://mp.weixin.qq.com/s/4GoyC3PZf5PuG3aF-y4AsQ
读取多行文字内容
 - Shared Function GetTchMText(ByVal ID As ObjectId) As String
- Dim doc As Document = Application.DocumentManager.MdiActiveDocument
- Dim ed As Editor = doc.Editor
- Dim ename As Long() = New Long() {0, 0}
- Dim result As Integer = acdbGetAdsName_R23_64(ename, ID)
- Dim rb As New ResultBuffer()
- Interop.AttachUnmanagedObject(rb, acdbEntGet(ename), True)
- Dim iter As ResultBufferEnumerator = rb.GetEnumerator()
- Dim DXF As New ArrayList
- While iter.MoveNext()
- Dim TmpVal As TypedValue = iter.Current
- If TmpVal.TypeCode = 1 Then
- Dim strValue As String = (If(TmpVal.Value IsNot Nothing, TmpVal.Value.ToString(), "*Nothing*"))
- Return strValue
- Else
- Continue While
- End If
- End While
- Return Nothing
- End Function
|