There are some issues I would like to adress here
You should be able to create just one udf. A good method creating a udf is to use an empty catpart and just add or create those elements that you want to use as input for the udf. In this case a curved surface and a point on the surface to start with, from that point create a line perpendicular to the surface and then a plane to place the hole/pocket.
I see that you "type" the udf to get the catgscript but have you also set the Knowledge environment in tools/option/parameters? So the KBE folder structure is created on the choosen path and the catgscript is created in the right place (knowldegeTypesCustom folder) and put the catalog and the part with udf in the knowledgeResourcesCatalogs folder. I've heard that this is not needed if the udf is in the same part as the pattern, that you can call on the udf directly, haven't tried it though... good to know maybe.
Regarding your code in the knowledge pattern I see some possible issues, it's little trickier when I don't see the environment and are not sure how you have made some steps.
You have typed the udf so I would try to declare it differently in the code, think that "let PlaneTangent(UserFeature)" can be used if it's not typed.
Try:
Let PTudf(PlaneTangent)
I'm just guessing that you have typed it as PlaneTangent, check the name of the catgscript.
You stated that the udf has two inputs but I only see one used in the code. A benefit with typed udf's are that you can directly call their inputs by their names.
Where is the other udf input? the surface? The variable SL is not declared, I guess it's the list
My version would look like:
let i(integer)
let PList(list)
let ListSize(integer)
let PTudf(PlaneTangent)
PList='Geometrical Set.1'.Query("Point","")
ListSize=PList->Size()
i=1
For i while i <=ListSize
PTudf=CreateOrModifyTemplate("ARMCatalog|PlaneTangent",PlaneSet ,`Relations\KnowledgePattern.3\PlaneList` , i)
PTudf.Point=(PList ->GetItem(i))
PTudf.Surface=??the missing surface???
EndModifyTemplate(PTudf)
i=i+1
}
Another interesting thing with knowledge patterns are that you can use it to create datum elements, with the function CreateOrModifyDatum, so this first udf you have made can be done in the code. Which R level du you have?