- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a custom drawing property called: MyCustom and set it value to "This". Via C# I want to change the value to "That". Currently I have the code to enumerate through the Database.SummaryInfo.CustomProperties which gets me down to MyCustom, but now "how" to change the value. That I cannot figure out. I can find how to create new custom properties, but I can't seem to find how to just change the value. I hoped it would be as simple as just setting the value, but that isn't working. So below is my code, that alas, is not working. I experimented around using:
DatabaseSummaryInfoBuilder dpbuilder = new DatabaseSummaryInfoBuilder();
But can't see how to use it except for creating new custom properties.
public static void setDwgProp(Database acDb, string dwgprop, string propval)
{
IDictionaryEnumerator denum = acDb.SummaryInfo.CustomProperties;
using (Transaction acTrans = acDb.TransactionManager.StartTransaction())
{
while (denum.MoveNext())
{
DictionaryEntry entry = denum.Entry;
if (entry.Key.ToString().ToUpper() == dwgprop.ToUpper())
{
entry.Value = propval;
}
}
acTrans.Commit();
}
}
Tangent question, how can I copy/paste my code so that it formats for easy reading?
Solved! Go to Solution.