Message 1 of 2
TagSTring, TextString, PrompString?

Not applicable
10-29-2003
05:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
When I make a select from all blocks in a drawing, I want to get the PromptString from an attribute, I'm using VB.NET which is very different from standard VB. The TagString and Textstring work ok, but I need the promptstring!
Here's my SUB...
Public Sub testIt()
Dim ss As AutoCAD.AcadSelectionSet
ss = myAutoCadApp.ActiveDocument.SelectionSets.Add("test")
Dim FilterType(0) As Short
Dim FilterCode(0) As Object
FilterType(0) = 2
FilterCode(0) = "WTBHFD"
ss.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType, FilterCode)
Dim a As AutoCAD.AcadBlockReference
Dim att As AutoCAD.AcadAttribute
Dim atts As Object
Dim i As Integer
Dim strAttributes As String
i = 0
For Each a In ss
atts = a.GetAttributes
For i = LBound(atts) To UBound(atts)
strAttributes = strAttributes & " Tag: " & atts(i).TagString & _
" Value: " & atts(i).textString & vbNewLine
Next
TextBox1.Text = strAttributes
Next
End Sub
The Problem is that the PromptString is in an AcadAttribute type, don't have it, because atts is an object..
Is this possible?
When I make a select from all blocks in a drawing, I want to get the PromptString from an attribute, I'm using VB.NET which is very different from standard VB. The TagString and Textstring work ok, but I need the promptstring!
Here's my SUB...
Public Sub testIt()
Dim ss As AutoCAD.AcadSelectionSet
ss = myAutoCadApp.ActiveDocument.SelectionSets.Add("test")
Dim FilterType(0) As Short
Dim FilterCode(0) As Object
FilterType(0) = 2
FilterCode(0) = "WTBHFD"
ss.Select(AutoCAD.AcSelect.acSelectionSetAll, , , FilterType, FilterCode)
Dim a As AutoCAD.AcadBlockReference
Dim att As AutoCAD.AcadAttribute
Dim atts As Object
Dim i As Integer
Dim strAttributes As String
i = 0
For Each a In ss
atts = a.GetAttributes
For i = LBound(atts) To UBound(atts)
strAttributes = strAttributes & " Tag: " & atts(i).TagString & _
" Value: " & atts(i).textString & vbNewLine
Next
TextBox1.Text = strAttributes
Next
End Sub
The Problem is that the PromptString is in an AcadAttribute type, don't have it, because atts is an object..
Is this possible?