Interacting with unmodeled link

i m using unmodeled link but i cant seem to find and delete it
Screenshot%20from%202019-02-13%2011-08-55

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 Part.data, 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.