Checking for Error Using Method Intent

Checking for Error Using Method Intent

inulobo
Advocate Advocate
425 Views
2 Replies
Message 1 of 3

Checking for Error Using Method Intent

inulobo
Advocate
Advocate

How do I check if a value has errored in an if statement. I have tried numerous methods to deal with the error but nothing has worked for me so far. The dimension is floating and invisible on the page. Attached is set to true. The only way I can see that the dimension is bad is through the method intent. I have attached images below. 

 

 

 

 

Dim oOrdinateDim As OrdinateDimension
Set oOrdinateDim = oDrawingDim
If IsError(oOrdinateDim.Intent.Geometry.Parent.Name) = True Or oOrdinateDim.Attached = False Then

oDrawingDim.Delete
End If

 

 

 

 

inulobo_0-1605282112235.png

inulobo_1-1605282118694.png

 

 

0 Likes
426 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor

did you try "On Error GoTo". Something like this...

On Error GoTo ErrorHandler 
  If IsError(oOrdinateDim.Intent.Geometry.Parent.Name) = True Or oOrdinateDim.Attached = False Then
    oDrawingDim.Delete
  End If
Exit Sub 
ErrorHandler: 
   MsgBox("Something went wrong! Do something about it.")
Resume Next 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 3

inulobo
Advocate
Advocate

I actually wrote something very similiar. Still did not work. For some reason it just always goes to that one line and continues to tell me the error message. I want to delete the dimension because it has that error. It weird that it doesn't seem to work.

0 Likes