Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

JLink to place UDF

jbryant74
10-Marble

JLink to place UDF

I want to understand how difficult it would be to reproduce this functionality using the free version of JLink. Currently, we have some Smart Assembly licenses and use them for placing UDFs. How challenging would it be to achieve the same with JLink, so we can deploy to a larger group without relying on Smart Assembly licenses? Here is a sample bit of code that we use in Smart Assembly. Basically, it shows an image of what to select, and then the user makes a selection, which Smart Assembly uses to place the UDF.

MESSAGE_BOX_EX IMAGE lib:PIC\TC_00_0.GIF GENERAL "TOPCAP AXIS" "SELECT TUBE SURFACE" BUTTONS JUNK
USER_SELECT SURFACE TUBE_SURFACE
CREATE_UDF lib:udf\new_axis THIS UDF_GROUP
UDF_REF TUBE_SURFACE TUBE_SURFACE
END_CREATE_UDF
GET_GROUP_FEATURE UDF_GROUP 1 GROUP_FEA
SET_REF_NAME GROUP_FEA "SA_TOP_CAP_AXIS"
UNGROUP_FEATURES UDF_GROUP
SEARCH_MDL_REF EXCLUDE_INHERITED THIS AXIS "SA_TOP_CAP_AXIS" TOP_CAP_SPRING_AXIS
ACCEPTED SOLUTION

Accepted Solutions

It depends... If you have programming experience and Java.

Nothing extra ordinary.

Creating Features from UDFs
Method Introduced: pfcSolid.Solid.CreateUDFGroup

 

...\Creo X.0.X.0\Common Files\otk_java_free\otk_java_appls\jlinkexamples\pfcUDFCreateExamples.java

View solution in original post

4 REPLIES 4

It depends... If you have programming experience and Java.

Nothing extra ordinary.

Creating Features from UDFs
Method Introduced: pfcSolid.Solid.CreateUDFGroup

 

...\Creo X.0.X.0\Common Files\otk_java_free\otk_java_appls\jlinkexamples\pfcUDFCreateExamples.java

I have been mildly successful with this small project, but I am still having trouble figuring out how to assign a reference to a request from the UDF for a certain plane. For example, the prompt is "Select SCHRADER DEPTH PLANE." I have previously found this plane in the model tree and added it to the references:

Reference 1:

  • Name: com.ptc.wfc.Implementation.pfcSelect$Selection@ba2f4ec
  • Item Name: SCHRADER_DEPTH_PLANE
  • Item Type: Plane

My question is: how do I programmatically assign this reference to the prompt so it selects the reference automatically?

I figured it out. A silly "." was causing all my errors 🙂

Hi @jbryant74,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag 

Announcements

Top Tags