help
Root Question Message
//ElementId is type
//selectionList.SelectedItem is a list of string vals and then get current item. Without ToString() its an object.
string curItem = selectionList.SelectedItem.ToString();
ElementId curItemId = (ElementId)Enum.Parse(typeof(ElementId), curItem);
//curItemId error: type provided must be Enum. Parameter Name: Enum Type.
Autodesk.Revit.DB.Color overrideColor = new Autodesk.Revit.DB.Color(52, 235, 85);
updateSequenceInOrderedSelect.OverrideColour(uiapp, curItemId, overrideColor, false);
string
to a new type called ElementId
as my method after this requires this. How do I do this? I used this as ref: https://stackoverflow.com/questions/60405465/cannot-implicitly-convert-type-string-to-autodesk-revit-bd-displayunittypeElementId
doesn't seem to be an enum selectionList.SelectedItem
already is a ElementId
. you would just have to cast it like this: ElementId curItemId = (ElementId)selectionList.SelectedItem
SelectedItem
is defined as object
so you can put any type in there, with the downside that you have to cast it into the right type when you get the item out again 😉