The only way I think you can do this, is to have the code that displays the
dialog (e.g., calls Application.ShowModalDialog()) open the file, after the
call to the latter returns.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6296370@discussion.autodesk.com...
hi,
thanks for your reply.. here is the code
// Button click
private void btnEditTemplate_Click(object sender, EventArgs e)
{
// Hiding the first modal dialog
this.Hide();
// Function call to open the dwg file and show the second modal dialog
(this function is in commands.cs file)
Commands.ShowTemplateEdit(filename,
tvTemplates.SelectedNode.Parent.Text);
}
// Function in commands.cs
// Function to show the drawing and edit template window (Only for edit)
static public void ShowTemplateEdit(string filename,string std)
{
// Declaring the second form object
CreateTemplate objCreate;
Editor ed =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
filenameforOpen = filename;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
=
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(filename,
false);
objCreate = new CreateTemplate(std, filename, "Edit");
Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(objCreate);
}
Edited by: jithin.dcs on Nov 30, 2009 10:31 AM