I really need to start reading my AutoCAD VBA book.
Anyway, I can't get this to work for me. The code is simple, but I keep getting an error.
What is supposed to happen is I'll select a whole bunch of entities, then run this macro to delete solely dimensions:
[vba]
Option Explicit
Sub Delete_Dims()
'On Error Resume Next
Dim oDim As AcadDimension
For Each oDim In ThisDrawing.ActiveSelectionSet
'On Error Resume Next
oDim.Delete
Next
End Sub
[/vba]
The error will come up in the For loop OR in the oDim.Delete, depending where I place the On Error Resume Next statement. Either way, the error is saying that oDim = Nothing...but I can't use an IF statement like:
If oDim = Nothing Then.....
I'm not sure what to do to get this to work out...any help is appreciated