Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can I add a ListDefinition with my custom string items?
I have try this code:
Db.ListDefinition listdef = new Db.ListDefinition();
ObjectId listdefid;
using (OpenCloseTransaction trans = db.TransactionManager.StartOpenCloseTransaction())
{
listdefid = db.AddDBObject(listdef);
trans.AddNewlyCreatedDBObject(listdef, true);
listdef.AddListItem("fisrt");
listdef.AddListItem("second");
listdef.AddListItem("555");
trans.Commit();
}
PropertyDefinition propDefManual2 = new PropertyDefinition();
propDefManual2.SetToStandard(db);
propDefManual2.SubSetDatabaseDefaults(db);
propDefManual2.Name = "ManualPropList";
propDefManual2.Description = "Manual property List";
propDefManual2.DataType = Autodesk.Aec.PropertyData.DataType.List;
propDefManual2.ListDefinitionId = listdef.Id;
propDefManual2.DefaultData = "555";
propSetDef.Definitions.Add(PropDefManual2);
I can see my properties:
But this list don't shown in the list definition area:
Solved! Go to Solution.