Skip to main content
Jul 9, 2019 2:08 PM UTC
Solved

How to add dropdown with values from IF statement to UDF

Hi everybody?

I would like to create an UDF to create keyway grooves on a Shaft based on the DIN 6885.
For example, a shaft with a diameter between 5mm and including 8mm, has a keyway-groove with a depth of 1.2mm, a width of 2mm, and a possible length of 6mm, or 8mm, or 10mm, or 12mm, or 14mm, or 16mm, or 18mm, or 20 mm.

When placing an UDF on a shaft I would like to have a dropdown with the possible values for the length appearing, or a prompt with the question to choose between the length values that are applicable for that range of shaft diameter.

Is this possible?

Greetings Mathieu

tbraxtonAnswer
Jul 9, 2019 6:50 PM UTC
From PTC help files;
You can create a UDF with the following dimension types:
• Variable dimensions—Dimensions for which you will enter values when you place the UDF in a part.
• Invariable dimensions—Dimensions that you will not change when you place the UDF in a part.
• Table-driven dimensions—Dimensions and dimension tolerances for which values are given in a family table. Every instance in the family table has its own dimension values.
 
Using variable dim will prompt the user for a value. If you want to control it using dims based on shaft geometry as a parent then you should check out Pro/Program.

2 replies

tbraxtonAnswer
Jul 9, 2019 6:50 PM UTC
From PTC help files;
You can create a UDF with the following dimension types:
• Variable dimensions—Dimensions for which you will enter values when you place the UDF in a part.
• Invariable dimensions—Dimensions that you will not change when you place the UDF in a part.
• Table-driven dimensions—Dimensions and dimension tolerances for which values are given in a family table. Every instance in the family table has its own dimension values.
 
Using variable dim will prompt the user for a value. If you want to control it using dims based on shaft geometry as a parent then you should check out Pro/Program.
Mathieu_TAuthor
Jul 10, 2019 8:48 AM UTC

Hi @tbraxton,

 

Thank you for the answer. I tried with the pro/program, and it works, however to be able to activate the pro/program in UDF, you should choose Subordinate, and not Stand Alone. Otherwise pro/program is not available in the options to choose from.