finding a handle acad2000

finding a handle acad2000

Anonymous
Not applicable
236 Views
2 Replies
Message 1 of 3

finding a handle acad2000

Anonymous
Not applicable
all

If I have an entity's handle I can turn it into an object....

Sub makeobject()
Dim Obj As AcadObject
the_handle = "4E"
Set Obj = ThisDrawing.HandleToObject(the_handle)
End Sub

The presupposes that I know the handl is 4E. However if I use sendcommand
or a script to draw an entity, how do I then query through VBA for its
assigned handle in Acad2000?

Also, do handles persist after a sequence of dxfout then dxfin?
rex
0 Likes
237 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
This will get the most recent visible entity

MySS.Select acSelectionSetLast

And about the handles, don't use them for
anything else than tracking your object in
the drawing they were created in.
You can add xdata to entities and use your
own ID to track objects outside their original
drawing

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"trexx" wrote in message
news:4859439@discussion.autodesk.com...
all

If I have an entity's handle I can turn it into an object....

Sub makeobject()
Dim Obj As AcadObject
the_handle = "4E"
Set Obj = ThisDrawing.HandleToObject(the_handle)
End Sub

The presupposes that I know the handl is 4E. However if I use sendcommand
or a script to draw an entity, how do I then query through VBA for its
assigned handle in Acad2000?

Also, do handles persist after a sequence of dxfout then dxfin?
rex
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks Jorge on your insight on using xdata. I'm not quite there yet with
my programming skills. I find the SelectionSet concept very opaque even
without VBA entering the picture.

Could you give me a code snippet on using MySS.Select acSelectionSetLast to
select the last entity drawn. For example, if I issue a SendCommand to
produce a circle, that I want to change it into an object using VBA. If
you could also show how to then attach an xdata string "hello world" to this
circle, that would be cool.
Thanks
REX

"Jorge Jimenez" wrote in message
news:4859460@discussion.autodesk.com...
This will get the most recent visible entity

MySS.Select acSelectionSetLast

And about the handles, don't use them for
anything else than tracking your object in
the drawing they were created in.
You can add xdata to entities and use your
own ID to track objects outside their original
drawing

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"trexx" wrote in message
news:4859439@discussion.autodesk.com...
all

If I have an entity's handle I can turn it into an object....

Sub makeobject()
Dim Obj As AcadObject
the_handle = "4E"
Set Obj = ThisDrawing.HandleToObject(the_handle)
End Sub

The presupposes that I know the handl is 4E. However if I use sendcommand
or a script to draw an entity, how do I then query through VBA for its
assigned handle in Acad2000?

Also, do handles persist after a sequence of dxfout then dxfin?
rex
0 Likes