Author Topic: .dll to reference for SendCommand  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

bchapman

  • Guest
.dll to reference for SendCommand
« on: February 03, 2013, 09:52:22 AM »
Anyone know which .dll I need to add to references to make SendCommand work?

ThankS!

Jeff_M

  • King Gator
  • Posts: 4040
  • C3D user & customizer
Re: .dll to reference for SendCommand
« Reply #1 on: February 03, 2013, 11:06:30 AM »
SendCommand() is an Autocad COM Interop method of the AcadDocument object.

SendStringToExecute() is an Autocad .NET API method of the Document object

bchapman

  • Guest
Re: .dll to reference for SendCommand
« Reply #2 on: February 03, 2013, 06:12:57 PM »
Thanks Jeff... can you show me how to set my doc =... it's apparent I am trying to use the .NET API method of the document object... not sure how to get the COM Interop method of the AcadDocument object. Also, I'm not sure if I need the "true,false,true" below... this command works fine with SendCommandtoExecute but I need one that will do this asynchronously. Code I'm working with is below:

Code: [Select]
namespace BCInsertBLock
{
    public class BCIBlock
    {
        [CommandMethod("BCC:INSERTBLOCK")]
        static public void BCinBLock()
        {

            Document Doc = Application.DocumentManager.MdiActiveDocument;
            string strSend = "-insert " + "ELVTAG" + "\n" + "0,0 1 45 \n";
            Doc.SendCommand(strSend, true, false, true);       
        }
    }
}


Any help tremendously appreciated and rewarded by donations to the swamp :)

bchapman

  • Guest
Re: .dll to reference for SendCommand
« Reply #3 on: February 03, 2013, 06:59:26 PM »
Think I might have found it...haven't tested.... also the reference files I needed were Interop and InteropCommon  dll's found in the C:\ObjectARX 2012 folder.


Code: [Select]
namespace BCInBLock
{
    public class BCCInBLock
    {
        [CommandMethod("BCC:InBlock")]
        static public void BCInsertBlock()
        {
            Document curDoc = Application.DocumentManager.MdiActiveDocument;
            AcadDocument curAcadDoc = (AcadDocument)curDoc.AcadDocument;
            string strSend = "-insert ELVTAG \n 0,0 1 45 \n ";
            curAcadDoc.SendCommand(strSend);       
        }
    }
}
« Last Edit: February 03, 2013, 08:52:39 PM by BC_in_NV »