Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

SaddamShaikh77
770 Vistas, 2 Respuestas

How to wait for a command to execute

Hello forum,
I am trying to execute the command "doc.SendStringToExecute((string)button.CommandParameter + "PDFATTACH", true, false, true);" or "doc.SendStringToExecute((string)button.CommandParameter + "PDFIMPORT", true, false, true);"

// some code after this

I want to execute the above lines completely and the next code should execute. Now it is not working as expected. I tried thread.sleep, task, async-await, but couldn't work for me.

 

Document doc = aCAD_App.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
"ed.CommandAsync("PDFATTACH", true, false, true);"

This also not worked.(I am trying to attach pdf in empty document)

also, 
Please suggest me any solution for this