I need some guidance on how to install an UDF into a part.
I have the UDF into a file. I cant seem to set the name of the UDF file to the object of type UDFCustomCreateInstructions.
Which is the command that should indicate which UDF should be inserted?
Secondly, I have the axis and plane datums that should be set as references and I am not sure which is the correct way to set the references.
Any suggestion or example is welcome.
There are multiple examples in the jlinkug which should be available to you in your install directory of Creo.
Anyway, your UDFCustomCreateInstructions should look something like this:
UDFCustomCreateInstructions instrs = pfcUDFCreate.UDFCustomCreateInstructions_Create ("hole_quadrant");
Thank you for your aswer.
I am aware of the example in the install directory. And still I havent found all the info I need.
For example, in your call, the "hole_quadrant" is the name of the UDF file? How do I specify a full path to the UDF file?
A UDF is either in the current directory, or you could have a UDF Library (specify the directory with the configuration file option "pro_group_dir".
I am now able to set the path to the UDF file following your suggestion.
I get a XToolkitGeneralError on inserting the UDF into my assembly and this is difficult to debug.
The examples in jlink folder are contained in standalone methods but they do not show how to pass the required arguments for the methods.
Can you advise how to debug or solve this situation?
I was able to modify the jlink examples to insert an UDF into my assembly but I get this with an error. A Failure Diagnostics window pops up and says:
Feature #16, Assembly xxx, failed regeneration.
- Feature aborted: cannot recreate internal datum
- Feature references are missing
Also in the Reference Viewer i can see that the new item inserted from the UDF misses one of the references - a cylinder surface.
How can I improve the reference configuration during the UDF insert?
I think some error as you mention is very often the case.
The first think what you need to do is to check your own udf and try to insert it via the Creo Parametric interface.
In this case you could see if it works and which references requires - some time for example the same reference could be required many times.
So therefore , please, check the udf and if the Creo Parametric UI shows exactly the same references and the promts what you used in the program.