zirafa115
05-22-2012, 10:39 PM
I can't get autocad static block attributes which equals to more than one digit.
For example:
Dim v As Variant
Dim oBkRef As IAcadBlockReference
v = oBkRef.GetAttributes
xxx = v(0).TextString
I need xxx to be the whole Attribute value, not just one digit of it.
Here is my all code:
Function maxi()
Dim ent As AcadEntity
Dim oBkRef As IAcadBlockReference
Dim v As Variant
Dim maxmax As Boolean
maxmax = 0
For Each ent In ThisDrawing.ModelSpace
If ent.ObjectName = "AcDbBlockReference" Then
Set oBkRef = ent
v = oBkRef.GetAttributes
If oBkRef.Name = "bl_mazgas" Then
If v(0).TextString > maxmax Then
maxmax = v(0).TextString
End If
End If
Next ent
maxi = maxmax + 1
End Function
For example:
Dim v As Variant
Dim oBkRef As IAcadBlockReference
v = oBkRef.GetAttributes
xxx = v(0).TextString
I need xxx to be the whole Attribute value, not just one digit of it.
Here is my all code:
Function maxi()
Dim ent As AcadEntity
Dim oBkRef As IAcadBlockReference
Dim v As Variant
Dim maxmax As Boolean
maxmax = 0
For Each ent In ThisDrawing.ModelSpace
If ent.ObjectName = "AcDbBlockReference" Then
Set oBkRef = ent
v = oBkRef.GetAttributes
If oBkRef.Name = "bl_mazgas" Then
If v(0).TextString > maxmax Then
maxmax = v(0).TextString
End If
End If
Next ent
maxi = maxmax + 1
End Function