|
发表于 2004-4-16 15:31:51
|
显示全部楼层
求助,急!
仅供参考
Sub OUT_DAT(FileName As String)
Dim myStr As String
Dim sSetObj As AcadSelectionSet
Set sSetObj = ActiveDocument.SelectionSets.Add("TEST_SSET1")
Dim gpCode(0) As Integer
Dim dataValue(0) As Variant
gpCode(0) = 8
dataValue(0) = ActiveDocument.ActiveLayer.Name
Dim groupCode As Variant, dataCode As Variant
groupCode = gpCode
dataCode = dataValue
sSetObj.Select acSelectionSetAll, , , groupCode, dataCode
Open FileName For Output As #1
For iii = 0 To sSetObj.Count - 1
With sSetObj.Item(iii)
If StrComp(.ObjectName, "AcDbText", vbTextCompare) = 0 Then
x =.InsertionPoint
myStr = .TextString
If IsNumeric(myStr) Then
Print #1, x(0), x(1), Val(myStr)
End If
End If
End With
Next iii
Close #1
End Sub |
|