Having the element ID how do I get the element name? Element ID is in a parameter, and I want to execute a script with the element name as an input.
Another way is to adapt your script and make a method that figures out if name or ID is used
private static IDmsElement GetElement(IDms dms, string elementInfo)
{
if (elementInfo.Contains("/"))
{
DmsElementId dmsElementId = new DmsElementId(elementInfo);if (dms.ElementExists(dmsElementId))
{
return dms.GetElement(dmsElementId);
}
else
{
throw new ElementNotFoundException(dmsElementId);
}
}
else
{
if (dms.ElementExists(elementInfo))
{
return dms.GetElement(elementInfo);
}
else
{
throw new ElementNotFoundException($"No element found with name '{elementInfo}'");
}
}
}
Hi Jens, in this scenario I can’t change the script.