Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello:
I have the following code that does is look for a nested block called "NUM" and extract attributes on a grid.
After finding the block, I seek your handle, you can update its attributes in order.
The code works, but I think it goes to slow in making the process go I wonder if it is possible to accelerate it.
Thanks in advance.
Sub ActualizaAtributoBloqueNum(ByVal oBloqueSeleccion As String, _
ByVal IDHandle As String, _
ByVal Posicion As String, _
ByVal Identificador As String, _
ByVal descripcion1 As String, _
ByVal descripcion2 As String)
Dim oBloquePadre As Object = Nothing
Dim oBloqueHijo As Object
Dim AttArray As Object
Dim oBlkDefOut As AcadBlock
Dim NombreBloqueFiltro As String
' Nombre del bloque hijo.
' 0 = Posicion
' 1 = Identificador
' 2 = Descripcion 1
' 3 = Descripcion 2
NombreBloqueFiltro = "NUM"
For Each oBloquePadre In oApp.ActiveDocument.Blocks
If oBloquePadre.Name = oBloqueSeleccion Then
oBlkDefOut = oBloquePadre
For Each oBloqueHijo In oBlkDefOut
If oBloqueHijo.handle = IDHandle Then
If TypeOf oBloqueHijo Is AcadBlockReference Then
If oBloqueHijo.EffectiveName = NombreBloqueFiltro Then
If oBloqueHijo.HasAttributes Then
AttArray = oBloqueHijo.GetAttributes
For I = LBound(AttArray) To UBound(AttArray)
AttArray(0).TextString = Posicion
AttArray(1).TextString = Identificador
AttArray(2).TextString = descripcion1
AttArray(3).TextString = descripcion2
Next
End If
End If
End If
End If
Next
End If
Next
End Sub
Solved! Go to Solution.