private void TheSetSheetCustomProperty(IAcSmPersist owner, Dictionary<string, string> kval)
{
Autodesk.AutoCAD.ApplicationServices.Document activeDocument;
activeDocument = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
// Create a reference to the Custom Property Bag
AcSmCustomPropertyBag customPropertyBag = default(AcSmCustomPropertyBag);
if (owner.GetTypeName() == "AcSmSheet")
{
AcSmSheet sheet = (AcSmSheet)owner;
customPropertyBag = sheet.GetCustomPropertyBag();
IAcSmEnumProperty enumeratorProperty;
enumeratorProperty = customPropertyBag.GetPropertyEnumerator();
AcSmCustomPropertyValue customPropertyValue = null;
enumeratorProperty.Next(out string name, out customPropertyValue);
while (!(customPropertyValue == null))
{
// if (name == propertyName)
if (kval.ContainsKey(name) == true)
{
customPropertyValue.SetValue(kval[name]); // <-- This
customPropertyBag.SetProperty(name, customPropertyValue); // <-- and this
}
enumeratorProperty.Next(out name, out customPropertyValue);
}
}
}