Editing Dimension Text using VBA

Editing Dimension Text using VBA

Anonymous
Not applicable
373 Views
3 Replies
Message 1 of 4

Editing Dimension Text using VBA

Anonymous
Not applicable
I want to write a macro that adds "(TYP.) to any dimension I click on.

I am new to VBA and would like a littl help. Thanks!
0 Likes
374 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
I have a similar one on what you need
See how it will work for you

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
Option Explicit


Public Sub SelectMulty()
'' based on Tony Tanzillo technic
'' request check "Break on Unhandled Errors" in General options
Dim varPt As Variant
Dim oEnt As AcadEntity
Dim dme As AcadDimension

Do
On Error Resume Next
ThisDrawing.Utility.GetEntity oEnt, varPt, "Select Dimension: "
If Err Then
Err.Clear
Exit Do
End If
On Error GoTo 0

If Not oEnt Is Nothing Then
If oEnt.ObjectName Like "*Dim*" Then
Set dme = oEnt
dme.TextPrefix = "TYP."
dme.Update
Set oEnt = Nothing
End If
End If
Loop
On Error GoTo 0

End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

~'J'~
0 Likes
Message 3 of 4

Anonymous
Not applicable
PERFECT!!
0 Likes
Message 4 of 4

Anonymous
Not applicable
You're welcome

~'J'~
0 Likes