.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SendStringToExecute sequence and EntLast

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
david_rock
501 Views, 2 Replies

SendStringToExecute sequence and EntLast

Hello,

When I use the following code, the OK message comes before the pasteclip operation.

So I cannot then get the object that was pasted using Entlast.

doc.SendStringToExecute("._pasteclip " & strOrigin & " ", True, False, True)
MsgBox("OK")
Dim objObjectIdOLE As ObjectId = AutoCAD.Internal.Utils.EntLast

Any ideas on why this is, how I can run the code in the correct sequence and get the objectId of the pasted object?

Kind Regards

David

 

 

2 REPLIES 2
Message 2 of 3
FRFR1426
in reply to: david_rock

All calls to SendStringToExecute() are queued and executed after your command ends. You should use another way to transfer your data, like Database.Wblock() method for example if you want to copy some entities from one database to another one.

 
Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Message 3 of 3
_gile
in reply to: david_rock

Hi,

 

in addition to what @FRFR1426 said, you can also try to use the Editor.Command() method which runs synchronously (requires AutoCAD 2015 or later).

doc.Editor.Command("._pasteclip, Point3d.Origin)

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta