I am trying to create a PropertySet in currently active design document in AutoCAD, but I am getting an exception eInvalidInput in the following line,
var dictionaryPropertyDataFormat = new DictionaryPropertyDataFormat(database);
The whole method looks like below.
internal static void CreatePropertySet()
{
var database = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
try
{
var dictionaryPropertyDataFormat = new DictionaryPropertyDataFormat(database);
var propertySetDefinition = new PropertySetDefinition();
using (Transaction transaction1 = database.TransactionManager.StartTransaction())
{
//Code to create PropertySet.
}
}
catch(System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Any suggestions or ideas on what I am doing wrong here.
Thanks in advance.