PDA

View Full Version : UI problems again



trichardson.155519
2007-12-21, 10:37 PM
I may be premature in posting this, but I've done several searches and I have essentially hit a brick wall.... again.

I'm trying to open a document from a UI. It is a Modal form that is called with Application.ShowModalDialog();

To complicate things somewhat, I will eventually need to open it across the network.

here is what I'm working with:



void buttonAddPlat_Click(object sender, EventArgs e)
{

try
{
using (DocumentLock dl = Application.DocumentManager.MdiActiveDocument.LockDocument())
{
DocumentCollection dm = Application.DocumentManager;
dm.Open("c:\\plat_template.dwg"); //DocumentManager.Open(platTemplate);
//platTemplate = \\server\share
}
}
catch (System.Exception)
{

throw;
}
}

I've tried taking out the document lock (and admittedly, the document is more cryptic to me at this point, I'm still working on learning autocad's functionality)

I'm Still working on this, and if I figure it out, I'll post. If helpful, the form performing the function is called by a parent form which is instantiated by a command method.

Better documentation (or better understanding therein) of the Runtime library might be extremely helpful here.

-TR

Opie
2007-12-26, 10:37 PM
Are you trying to open a particular file? Is this file meant to be a template for a new project?

Can you explain a little more on what your ultimate goal is?

T.Willey
2007-12-27, 06:04 PM
I had a problem like this before. I had to close my form before I could open up any drawings, so you might try that. You might be able to make it invisible, but I'm not sure if I got that to work or not.