.NET

Reply
New Member
rtonin
Posts: 1
Registered: ‎07-19-2005
Message 1 of 1 (322 Views)

SummaryInfo c#

322 Views, 0 Replies
07-19-2005 04:45 AM
I have wrote this class to read/write summaryInfo for a drawing
public class AutoCADDocumento
{
private Autodesk.DatabaseServices.DatabaseSummaryInfoBuilder m_prop;
public AutoCADDocumento()
{
}
private void BeginEditCustomProperties()
{
m_prop = new DatabaseSummaryInfoBuilder(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.SummaryInfo);
}

private void EndEditCustomProperties()
{
int i = m_prop.CustomProperties.Count;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.SummaryInfo = m_prop.ToDatabaseSummaryInfo();
m_prop = null;
}
public bool Codifica()
{
this.BeginEditCustomProperties();
m_prop.Title = "Test di prova";
this.EndEditCustomProperties();
return true;
}

when i create an istance of this class and i call the method Codifica I receive an elockviolation exception with this stack:
at Autodesk.AutoCAD.Runtime.Interop.ThrowExceptionForErrorStatus(Int32 errorStatus)
at Autodesk.AutoCAD.Runtime.Interop.Check(Int32 returnValue)
at Autodesk.AutoCAD.DatabaseServices.DatabaseSummaryInfo.CopyToUnmanagedObject(IntPtr unmanagedPointer)
at Autodesk.AutoCAD.DatabaseServices.Database.set_SummaryInfo(DatabaseSummaryInfo value)
at Idroesse.IdroesseNETWinForms.AutoCAD.AutoCADDocumento.EndEditCustomProperties() in d:\idroessenet\idroessenetaddin\idroessenetwinforms\classi\autocad\autocaddocumento.cs

if i open the Drawing Property Dialog in AutoCAD I found the Title property unchanged (empty)
What can i do?
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!