Message 1 of 2

Not applicable
02-27-2018
08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am adding blockreferences to a drawing from Excel with a plugin i created. I attach a self-defined property set called "Elektroteknikk" to the references but when i try to save the drawing i get the following error:
"One or more objects in this drawing cannot be saved to the specified format. The operation was not completed and no file was created"
I am using the standard aecpropdatamdg dll.
But when i manually attach the propertysetdefinition to the blockreferences in autocad i am able to save the drawing.
This is the code i am using to attach the propertysetdef and values to the blockrefrence
if (PropDefValues != null) { var propSetDef = (PropertySetDefinition)PropDefValues[-1]; using (Transaction tr2 = db.TransactionManager.StartOpenCloseTransaction()) { PropertyDataServices.AddPropertySet(br, propSetDef.Id); tr2.Commit(); } var propSetId = PropertyDataServices.GetPropertySet(br, propSetDef.Id); using (var propSet = (PropertySet)tr.GetObject(propSetId, OpenMode.ForWrite, false)) { foreach(var KVPair in PropDefValues) { if(KVPair.Key != -1) propSet.SetAt(KVPair.Key, KVPair.Value); } } }
ANY help??
Solved! Go to Solution.