Message 1 of 3
Variable set?
Not applicable
04-25-2000
09:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to check if a variable dim'ed as an acad entity is set or not. I
currently check a property in the entity, then check the value of err.number
for 0. Quick example below.
Private Sub cmdExsists_Click()
Dim objBlock As AcadEntity
Dim xyzPnt As Variant
Dim varTest As Variant
Me.Hide
On Error Resume Next
ThisDrawing.Utility.GetEntity objBlock, xyzPnt, "Pick an object :"
varTest = objBlock.ObjectID
If Err.Number <> 0 Then
MsgBox "No object selected"
Else
MsgBox "You have selected an object"
End If
Me.Show
End Sub
Yes, I do know that I can check Err.Number right after the GetEntity
statement, this is just a quick example.
What I want is something like this:
If IsEmpty(objBlock) then...
But this does not work. Neighter does "IsObject".
Is there any way to check whether objBlock has a value or not directly?
Anyone?
--
Rune Wold
Application Designer
Engineering Systems
[email protected]
--
currently check a property in the entity, then check the value of err.number
for 0. Quick example below.
Private Sub cmdExsists_Click()
Dim objBlock As AcadEntity
Dim xyzPnt As Variant
Dim varTest As Variant
Me.Hide
On Error Resume Next
ThisDrawing.Utility.GetEntity objBlock, xyzPnt, "Pick an object :"
varTest = objBlock.ObjectID
If Err.Number <> 0 Then
MsgBox "No object selected"
Else
MsgBox "You have selected an object"
End If
Me.Show
End Sub
Yes, I do know that I can check Err.Number right after the GetEntity
statement, this is just a quick example.
What I want is something like this:
If IsEmpty(objBlock) then...
But this does not work. Neighter does "IsObject".
Is there any way to check whether objBlock has a value or not directly?
Anyone?
--
Rune Wold
Application Designer
Engineering Systems
[email protected]
--