How to add programmatically tool custom types as capable resource?

Hi,

I have a question, currently customer is using a custom type for tooling objects and these elements then can be interactively assigned/linked as capable resources on the Native Client. Now as there're many processes and tools we want to automate the assignment by means of a script using "CreatePrimaryCapableResourceLink" but from the documentation the input need to be a PLMResource type object --> "let MyResourceRef(PLMResource)" if I want to cast the custom type into a PLMResource what I get is a NULL result on the casting and no link can be created. Is there a way to use the custom type as capable resource using EKL?

Link to the function: https://help.3ds.com/2022x/english/dsdoc/prrusermap/eklmsd-r-plmproductionsystemadvfunctionpackagefunctions.htm?contextscope=onpremise#r-PLMCoreReference_CreatePrimaryCapableResourceLink_PLMResource_DELAsmProcessCanUseCnx

Any help is appreciated

Thanks