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

Command line

3 REPLIES 3
Reply
Message 1 of 4
cadcamm99
449 Views, 3 Replies

Command line

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.

3 REPLIES 3
Message 2 of 4
Alfred.NESWADBA
in reply to: cadcamm99

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
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 4
cadcamm99
in reply to: Alfred.NESWADBA

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.

Message 4 of 4
finnishflash
in reply to: cadcamm99

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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost