Example attached ... current: cogo points have descriptions (Not the Field, the property - dont ask!).
Need to transfer these values to a custom field - already available in the dwg (custom class, general name)
This code, to read the custom fields works fine:
foreach (IAeccUserDefinedPropertyClassification udpc1 in CDb.PointUserDefinedPropertyClassifications)
{
foreach (IAeccUserDefinedProperty udp1 in udpc1.UserDefinedProperties)
{
if (udp1.PropertyFieldType == AeccUDPPropertyFieldType.aeccUDPPropertyFieldTypeString)
{
listBox2.Items.Add(udp1.Name);
}
}
}
Error occurs when trying to set the custom field: (default case):
IAeccPoint pnt1 = CDb.Points.Item(i1);
switch (listBox3.SelectedItems[0].ToString())
{
case "Description":
To1 = pnt1.Description;
break;
case "Raw Description":
To1 = pnt1.RawDescription;
break;
case "Name":
To1 = pnt1.Name;
break;
default:
To1 = (string)pnt1.GetUserDefinedPropertyValue(listBox3.SelectedItems[0].ToString());
break;
}
To1 = (string)pnt1.GetUserDefinedPropertyValue(listBox3.SelectedItems[0].ToString()); causes error - unspecified ...