Anuncios

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

How to wait for a command to execute

SaddamShaikh77
Advocate

How to wait for a command to execute

SaddamShaikh77
Advocate
Advocate

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

0 Me gusta
Responder
Soluciones aceptadas (1)
772 Vistas
2 Respuestas
Respuestas (2)

Michiel.Valcke
Advisor
Advisor

Hello,

If you are trying to make this a part of a macro, lsp, vba module or anything you will find help more quickly in the AutoCAD customization forums.

cadffm
Consultant
Consultant
Solución aceptada

 

 


@Michiel.Valcke wrote:

If you are trying to make this a part of a macro, lsp, vba module or anything you will find help more quickly in the AutoCAD customization forums.


For VBA we have a separately board.

https://forums.autodesk.com/t5/autocad/ct-p/8

 

And saddam is using .NET (if  i am right with this), for .NET API there is also a separately board available.

https://forums.autodesk.com/t5/net/bd-p/152

where saddam can search about his topic and start a new thread if needed.

Some interesting threads there like this

https://forums.autodesk.com/t5/net/synchronous-sendcommand/m-p/5574225#M43951

 

Sebastian

0 Me gusta