如何从DRAWING获取文本的坐标和内容
小弟初学编程,现在工作中需要把CAD图纸中的文本读出并放入表格,需要得到文本的内容和文本的坐标,Dim sset As AcadSelectionSet<BR>Set sset = ActDocument.SelectionSets.Add("S")
sset.SelectOnScreen
For Each Entry In sset
这中间我应怎么办?<BR>Entry.Update<BR>Next
请各位高手指教,万分感激!!!! Dim i As Integer
For i = 0 To ssetObj.Count - 1
Dim ent As AcadEntity
Set ent = ssetObj.Item(i)
If ent.ObjectName = "AcDbText" Then
Dim textObj As AcadText
Set textObj = ent
...
End If
Next 建议使用过滤器
Dim Select1 As AcadSelectionSet<BR>FilterType(0) = 0: FilterData(0) = "TEXT"<BR>Select1.SelectOnScreen FilterType, FilterData
Dim textobj As AcadText<BR>Dim Text_String As String<BR>Dim Text_InsertPoint As Variant
下面为TEXT文本的内容和坐标,注意只对应于DTEXT而不包括MTEXT
Text_String = textobj.TextString<BR>Text_InsertPoint = textobj.InsertionPoint
页:
[1]