cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to insert UDF with jlink

vjoer
6-Contributor

How to insert UDF with jlink

Hello

 

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.

 

Thank you

Regards

 

  

7 REPLIES 7

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");
vjoer
6-Contributor
(To:HamsterNL)

Hello

 

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?

 

Regards

 

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".

 

About Creating a UDF Library

Maybe this blog post helps?

 

Inserting User Defined Feature

vjoer
6-Contributor
(To:HamsterNL)

Hello

 

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?

 

Regards

vjoer
6-Contributor
(To:vjoer)

Hello

 

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?

 

Regards

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.

 

Top Tags