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.
There is no Visual Overview functionality that will make the ID to name translation for you. Typically IDs are provided as an input to a script. In there, you can easily request additional information of the element using its ID.
Note that you can access the element name of a page or shape using the [this element] placeholder, see help.
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.
Thanks, Sebastiaan. I decided to go for a workaround and add a second parameter in the driver with the element name.