I'm currently developing an Add-In with a variety of functions, one of them to align ports in a diagram horizontally.
Therefore, I need to get the current selected element/ port in a diagram ( in this case Hand(Port4)) as an "anchor" element so that the other selected ports align themselves to the same x - coordinate.
Example diagram I'm working on

In EA itself, it works wonderfully with
Select Object_ID, Name from t_object where Object_id = #CurrentElementID#
Going into my Add-In (that I'm developing in C# in Visual Studio 2022), I thought that I could do the same with a SQLQuery a la
String selectedPort = repository.SQLQuery("Select Object_ID, Name from t_object where Object_ID = #CurrentElementID# ");
Which gives me a syntax error at Object_ID = #CurrentElementID# and I don't know why tbh. I found this link where #OBJECTID# was suggested but that didn't work either.
How do I get around this problem and get the port.top - value so that I can align the other ports to it?