I assume you are trying to import a Space Style! But, the idea is the same for importing PropertySetDefiniton.
What do you mean by User Extended Parameters from AEC Space?
I did a very simple test and it's working correctly with CloningHelper.
Are you using CloningHelper MergeType = DictionaryRecordMergeBehavior.Overwrite?
[CommandMethod("ImportSpaceStyleTest")]
public void ImportSpaceStyleTest()
{
try
{
Database dbDestination = HostApplicationServices.WorkingDatabase;
string SourcePath = @"C:\temp\Spaces - Residential (Metric).dwg";
Database dbSource = new Database(false, true);
dbSource.ReadDwgFile(SourcePath, System.IO.FileShare.Read, true, "");
DictionarySpaceStyle dictSpaceStyle = new DictionarySpaceStyle(dbSource);
// get the list of style ids that you want to import.
// (1) if you want to import everything, use this:
// the list of ids in the style dictionary.
// ObjectIdCollection objCollectionsrc=dictStyle.Records;
// (2) if you want to import a specific style, use this:
// we assume you know the name of style you want to import.
AcDb.ObjectIdCollection objCollectionsrc=new AcDb.ObjectIdCollection();
objCollectionSrc.Add(dictSpaceStyle.GetAt("Bathroom_Large"));
// now use CloningHelper class to import styles.
// there are four options for merge type:
// Normal = 0, // no overwrite
// Overwrite = 1, // this is default.
// Unique = 2, // rename it if the same name exists.
// Merge = 3 // no overwrite + add overlapping as anonymous
Autodesk.Aec.ApplicationServices.Utility.CloningHelper helpme = new Autodesk.Aec.ApplicationServices.Utility.CloningHelper();
// helpme.MergeType = Autodesk.Aec.ApplicationServices.Utility.DictionaryRecordMergeBehavior.Normal;
helpme.MergeType = Autodesk.Aec.ApplicationServices.Utility.DictionaryRecordMergeBehavior.Overwrite;
// helpme.MergeType = Autodesk.Aec.ApplicationServices.Utility.DictionaryRecordMergeBehavior.Unique;
// helpme.MergeType = Autodesk.Aec.ApplicationServices.Utility.DictionaryRecordMergeBehavior.Merge;
helpme.Clone(dbSource, dbDestination, objCollectionSrc, dictSpaceStyle.RecordType, true);
}
catch (System.Exception e)
{ Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(e.Message);
}
}
[CommandMethod("ImportPropertySetDefinitionTest")]
public void ImportPropertySetDefinitionTest()
{
try
{
Database dbDestination = HostApplicationServices.WorkingDatabase;
string SourcePath = @"C:\temp\Schedule Tables (Metric).dwg";
Database dbSource = new Database(false, true);
dbSource.ReadDwgFile(SourcePath, System.IO.FileShare.Read, true, "");
DictionaryPropertySetDefinitions dictPropSetDef = new DictionaryPropertySetDefinitions(dbSource);
AcDb.ObjectIdCollection objCollectionsrc=new AcDb.ObjectIdCollection();
objCollectionSrc.Add(dictPropSetDef.GetAt("SpaceStyles"));
Autodesk.Aec.ApplicationServices.Utility.CloningHelper helpme = new Autodesk.Aec.ApplicationServices.Utility.CloningHelper();
helpme.MergeType = Autodesk.Aec.ApplicationServices.Utility.DictionaryRecordMergeBehavior.Overwrite;
helpme.Clone(dbSource, dbDestination, objCollectionSrc, dictPropSetDef.RecordType, true);
}
catch (System.Exception e)
{
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(e.Message);
}
}