public Profile GetProfile() { PromptEntityOptions peo = new PromptEntityOptions("\nSelect the profile view"); peo.SetRejectMessage("\nOnly profile view"); peo.AddAllowedClass(typeof(Profile), true); PromptEntityResult res = Ed.GetEntity(peo); if (res.Status != PromptStatus.OK) { return(null); } using (Transaction ts = Dwg.TransactionManager.StartTransaction()) { try { Profile prf = ts.GetObject(res.ObjectId, OpenMode.ForRead) as Profile; return(prf); } catch (System.Exception) { throw; } } }
public SampleLine GetSampleLine() { PromptEntityOptions peo = new PromptEntityOptions("\nSelect the SampleLine"); peo.SetRejectMessage("\nOnly SampleLine"); peo.AddAllowedClass(typeof(SampleLine), true); PromptEntityResult res = Ed.GetEntity(peo); if (res.Status != PromptStatus.OK) { return(null); } using (Transaction ts = Dwg.TransactionManager.StartTransaction()) { try { SampleLine smpLine = ts.GetObject(res.ObjectId, OpenMode.ForRead) as SampleLine; return(smpLine); } catch (System.Exception) { throw; } } }
public Alignment GetAlignment() { PromptEntityOptions opt = new PromptEntityOptions("\nSelect the Alignment:"); opt.SetRejectMessage("\nOnly alignment"); opt.AddAllowedClass(typeof(Alignment), true); PromptEntityResult res = Ed.GetEntity(opt); if (res.Status != PromptStatus.OK) { return(null); } ; using (Transaction ts = Dwg.TransactionManager.StartTransaction()) { try { Alignment al = ts.GetObject(res.ObjectId, OpenMode.ForRead) as Alignment; return(al); } catch (System.Exception) { throw; } } }