Cheers for the information.
Is there another way of gets an object's handle from its ID number if the
object has been erased?
VBA/VB gives an error that the object has been erased when using
.ObjectIDToObject.
Thanks in advance.
Ian
Public Function UndeleteObjectByHandle(Handle As Long) As AcadEntity
'bring back deleted object
'by calling (entdel) with the object's handle.
Dim lispstr As String
Dim VL As New VLAX
lispstr = "(entdel (handent """ & Handle & """))"
VL.EvalLispExpression lispstr
Set UndeleteObjectByHandle = ThisDrawing.Database.HandleToObject(Handle)
End Function
--
Ed
--
"Ian Swatton" <ian.s...@microdrainage.co.uk> wrote in message
news:oprmxx4j...@discussion.autodesk.com...
> How about this function:
>
> Public Function UndeleteObjectByHandle(Handle As Long) As AcadEntity
> 'bring back deleted object
> 'by calling (entdel) with the object's handle.
> Dim lispstr As String
> Dim VL As New VLAX
>
> lispstr = "(entdel (handent """ & Handle & """))"
> VL.EvalLispExpression lispstr
> Set UndeleteObjectByHandle = ThisDrawing.Database.HandleToObject(Handle)
> End Function
>
Cheers for this function...
This function looks good - but which reference file do I need to add to VBA
get the VLAX object/interface?
Thanks in advance
Ian
--
Ed
--
"Ian Swatton" <ian.s...@microdrainage.co.uk> wrote in message
news:oprmzwoi...@discussion.autodesk.com...
On Wed, 2 Apr 2003 08:48:25 -0800, Ed Jobe <edl...@hotmail.com> wrote:
> VLAX is a class module that wraps the vlide. Here is a link to a
> description
> of working with lisp in vba. http://code.acadx.com/articles/002.htm. Look
> for a link to vlax.cls.
>
> --
> Ed
> --
I've now tried this code which works (if you know the handle of the entity
that you want to undelete). However AutoCad only returns the objectID
number in the ACADDocument_ObjectErased event and there does not seem to be
away to map the objectID number back to the handle (which in VB/VBA is a
string whereas objectID is a long).
Thanks in advance for any further info.
Cheers
Ian