Home AutoCad VB Change Text in a Block
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Change Text in a Block PDF Print E-mail
User Rating: / 0
PoorBest 
Tutorials

Function to replace a text in a Block

Code:

[code]

Public Function ChangeTextinBlock(ByVal OldText As StringByVal NewText As String)

'***************************************************
'******* Code from VisibleVisual.com ***************
'******* Searches text in Block and changes it *****
'***************************************************
 
Dim i As Integer
Dim z As Integer
Dim BlkText As String
 
For i = 0 To ThisDrawing.Blocks.Count - 1
    For z = 0 To ThisDrawing.Blocks.Item(i).Count - 1
 
        BlkText = ""
        On Error Resume Next
        BlkText = ThisDrawing.Blocks.Item(i).Item(z).TextString
        If BlkText Like OldText Then
        ThisDrawing.Blocks.Item(i).Item(z).TextString = NewText
        End If
 
    Next z
Next i
 
ThisDrawing.Regen acAllViewports
End Function

[/code]

 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade