Interacting with unmodeled link

i m using unmodeled link but i cant seem to find and delete it

using the following code i need to find it and delete it

console on line 1313 returns null same goes for 1317
is there a way to delete unmodeled links through code??

Unmodeled Parts have no, so trying to find such a Part via its data cannot be successful.

If that unmodeled Link connects with a Group, then you should be able to find it by iterating over the links connected with that Group. Or over Diagram.links. Or by calling Diagram.findPartAt or similar geometrical methods.