- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Experts,
By Opening File into AutoCAD I can set the Custom Property(dwgname,dwgid,projectname) of the File.
But I want to set value of these properties without opening AutoCAD application.
I can set it using:
public void SetAttributes(Hashtable hashTable,String fileOpenPath)
{
Document Doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(fileOpenPath); //Can we create this Object using any other way??
Database Db = Doc.Database;
DatabaseSummaryInfoBuilder DbSib = new DatabaseSummaryInfoBuilder();
Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = Db.TransactionManager;
using (Transaction aTran = tm.StartTransaction())
{
foreach (DictionaryEntry entry in hashTable)
{
DbSib.CustomProperties.Add(entry.Key.ToString(), entry.Value.ToString());
}
Db.SummaryInfo = DbSib.ToDatabaseSummaryInfo();
aTran.Commit();
}
}
Solved! Go to Solution.