Message 1 of 5

Not applicable
02-17-2015
10:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to test if a dwg is created by Educational version.
This is my code so far
using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; namespace ExtractEMR { public class Commands { [CommandMethod("EMR")] static public void ExtractEMRFromFile() { Document doc = Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; // Ask the user to select a file PromptResult res = ed.GetString( "\nEnter the path of a DWG or DXF file: " ); if (res.Status == PromptStatus.OK) { // Create a database and try to load the file Database db = new Database(false, true); using (db) { try { db.ReadDwgFile( res.StringResult, System.IO.FileShare.Read, false, "" ); } catch (System.Exception) { ed.WriteMessage( "\nUnable to read drawing file." ); return; } Transaction tr = db.TransactionManager.StartTransaction(); using (tr) { string str = db.IsEMR(); ed.WriteMessage(str); } } } } } }
but its saying there is no definition for IsEMR.
Solved! Go to Solution.