Command line

Command line

Anonymous
Not applicable
714 Views
3 Replies
Message 1 of 4

Command line

Anonymous
Not applicable

How do you pause the program to run a command line. Ex. MyDrawing.SendStringToExecute("command", True, False, False).  I want to regen the drawing after the command.  I am using Autocad 2011.

0 Likes
715 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> I want to regen the drawing after the command.  I am using Autocad 2011

Just start

MyDrawing.SendStringToExecute("_REGEN", True, False, False)

...but it depends on from what source your app is running (from a command-method ... or from a palette-function ... or ...)

And as there can't run two command parallel (except some transparent ones) you SendStringToExecute will run after the current command ended, whatever that was. So it will regen the drawing after the command ... as you liked 😉

 

My feeling would be that you better should use the editor-funciton for that:

Call MyDrawing.Editor.Regen

(if "MyDrawing" is of type ApplicationServices.Document)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 4

Anonymous
Not applicable

I guess my real problem is that I want to run AMTITLE from a command line in my program.  After I put in the format, I want to regen the drawing.  But I can't seem to pause the program and restart it after putting in the format to regen the drawing.

0 Likes
Message 4 of 4

Anonymous
Not applicable

I'd suggest you use the COM api. Create a CommandMethod where you do something like this:

 

        Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
        AcadDocument acadDoc = doc.AcadDocument as AcadDocument;
        AcadApplication app = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication as AcadApplication;

        McadSymbolBBMgr symMgr = app.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr") as McadSymbolBBMgr;
        McadTitleBorderMgr oTbMgr = symMgr.get_TitleBorderMgr(acadDoc);

        McadTitleBorderDescriptor tbDesc = oTbMgr.NewDescriptor();

        tbDesc.Border.Name = "yourBorder";
        tbDesc.Title.Name = "yourTitle";
        McadTitleBorderContext tbCtxt = oTbMgr.NewContext();
        McadTitleBorder tb = oTbMgr.CreateTitleBorder(tbDesc, tbCtxt);

 after that you may also throw in a

 

doc.Editor.Regen();

 

However, I don't think the latter is necessary.

 

Good Luck

Paavo Rantanen

0 Likes