Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Forum,
the following code gives me an eNotFromThisDocument error:
[LispFunction("MyFunction")]
public ResultBuffer MyFunction(ResultBuffer rbParameter)
{
...
objDocument = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(strPath, false);
if (!objDocument.IsReadOnly)
{
using (objDocumentLock = objDocument.LockDocument())
{
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument = objDocument;
objDocument.Database.TileMode = true; // = eNotFromThisDocument.
}
objDocument.CloseAndSave(strPath);
objDocument.Dispose();
}
...
}I think it is because the Editor does not get linked to the newly opened drawing. In other words, I can not change tilemode of objDocument, because the drawing from which I called this function is still the active/current drawing. How can I tell AutoCAD that objDocument should be the active/current drawing, so I can change the tilemode, and use Editor functionality, such as SendString()?
Thank you.
Solved! Go to Solution.