Message 1 of 7
Extracting attribute information from existing blocks

Not applicable
08-18-2000
05:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anyone help !
I currently have some code which works fine until other entitys are added
into the drawing.
When executing, a 'Type Mismatch' error is displayed.
Would I be correct in thinking it is something to do with Blocks statement ?
Thanks in advance
Dave
The code is as follows:
Dim SelSetObj As AcadSelectionSet
Dim Num As Integer
'interogate drawing for scale and revsion status
'set up selection set
Set SelSetObj = ThisDrawing.SelectionSets.Add("TEST_SSET")
SelSetObj.Select acSelectionSetAll
Num = SelSetObj.Count
'read block attributes and set to user input
** For Each Blocks In SelSetObj **
If Blocks.EntityName = "AcDbBlockReference" Then
If Blocks.HasAttributes = True Then
Attributes = Blocks.GetAttributes
For I = LBound(Attributes) To UBound(Attributes)
If Attributes(I).TagString = "REV" Then
NewRev = Attributes(I).TextString + 1
Attributes(I).TextString = NewRev
End If
If Attributes(I).TagString = "SCALE" Then
FrameScale = Attributes(I).TextString
End If
Next
End If
End If
Next
I currently have some code which works fine until other entitys are added
into the drawing.
When executing, a 'Type Mismatch' error is displayed.
Would I be correct in thinking it is something to do with Blocks statement ?
Thanks in advance
Dave
The code is as follows:
Dim SelSetObj As AcadSelectionSet
Dim Num As Integer
'interogate drawing for scale and revsion status
'set up selection set
Set SelSetObj = ThisDrawing.SelectionSets.Add("TEST_SSET")
SelSetObj.Select acSelectionSetAll
Num = SelSetObj.Count
'read block attributes and set to user input
** For Each Blocks In SelSetObj **
If Blocks.EntityName = "AcDbBlockReference" Then
If Blocks.HasAttributes = True Then
Attributes = Blocks.GetAttributes
For I = LBound(Attributes) To UBound(Attributes)
If Attributes(I).TagString = "REV" Then
NewRev = Attributes(I).TextString + 1
Attributes(I).TextString = NewRev
End If
If Attributes(I).TagString = "SCALE" Then
FrameScale = Attributes(I).TextString
End If
Next
End If
End If
Next