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.
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 -
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.
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