Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated UDF's 2

Status
Not open for further replies.

Duder58

Petroleum
Feb 6, 2014
14
I am relatively new to NX and I have a UDF of an o-ring port that I would like to automate using NXOpen or SNAP where the user would pick the thread size from a dialog box and based upon their selection would change the dimensional values of the port to match that of the thread size they selected. I have 13 different thread sizes ranging from 5/16-24 to 2-1/2-12 and there are 9 different dimensions that would change based upon the selection of a thread size. If this is possible I can send the NX part and the details of the dimensional data. I have decent programming skills in Visual Basic but I just need someone to get me pointed in the right direction if this is even possible. We initially thought about using a part family for the different thread sizes but we want the different sizes presented to the user perhaps in a dialog box so they can select which size they want and the UDF would then be created.

Thanks in advance for any help.
Scott
 
Replies continue below

Recommended for you

Yes, please provide the example part file. I think this can be accomplished using Attributes and 'list' expressions to drive your model. Also provide the information on the paramaters that change based on the thread sizes and what those values are for each specific thread spec. Note that the approach that I'm thinking of will only work if you're running at least NX 8.0 or newer.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
John, We are running NX 8.5 and I have attached the UDF part file and the dimensional data that will change for each thread size.

 
OK, let me take a shot at this.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
OK, I've got a working model (see attached file) but it only works thru the 7/8-14 size as all the thread-sizes above that are non-standard. Now I can make it work but I'll need the detailed thread data for those larger sizes. Anyway, you can play with the UDF as long as you stick to the smaller sizes until you can supply me with the details that I need to add the non-standard threads to the thread table. I can probably extrapolate the needed values, but if you can provide them for me that would be great.

Note that the way you use the UDF is that you only need to supply a single number from 1 thru 13 representing the size of the threaded hole (of course, at the moment only 1 thru 7 is working).

Before you ask, the way I got this down to working by entering only one number is through the use of 'List' expressions to store the values for all of the variables. As for the threaded hole, I replaced your revolved hole and symbolic thread with an actual threaded-hole which updates as long as the size can be found in the Threaded-Hole table.

Anyway, take a look and let me know if you can supply the needed data for the non-standard threads. This includes, major diameter, minor diameter and tap drill size. As I said I can extrapolate them, but if you already have them that would be better.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
 http://files.engineering.com/getfile.aspx?folder=ea724377-3572-4bb3-aa38-1fb7b1c9a125&file=ES394_NEWEST.prt
John, looks good so far. Here is the dimensional data for the larger size threads.

MAJOR DIA MINOR DIA TAP DRILL
1-1/16-12 1.0625 .981 .990
1-3/16-12 1.1875 1.006 1.115
1-5/16-12 1.3125 1.231 1.240
1-5/8-12 1.625 1.544 1.553
1-7/8-12 1.875 1.794 1.803
2-1/2-12 2.500 2.419 2.178

Will this information need to be added to the threaded hole XML file that is used by NX?

Thanks again,
Scott
 
I'll produce a new updated threaded-hole table which you'll need to use. It will just be a matter of replacing one file with the updated one. I'll provide the details when I get the file updated.

Have you tested what I got done? Is this what you were looking for? Have you looked at how I formatted your parameter data using the 'List' expressions?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
The last set of numbers, for the 2 1/2-12 thread, can you please double-check them as they don't feel right?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
OK, I've worked out all the sizes, including the last one, which was messed-up but I got the data from another source.
Attached is a zip file containing an updated UDF master and the modified threaded-hole table. As for what to do with the threaded-hole file, there are two options. The easiest is to simply replace the old file with the new one but that means that the file could be clobbered during an update or when you upgrade to a new version of NX. The safest approach is to put the modified data file in some 'safe' folder somewhere and then set an environment variable pointing to this folder.

Now the current threaded-hole table is located at...

...\UGII\modeling_standards

...so if you're going the replacement route, just put the modified threaded-hole file there, replacing the current one.

If you go the modified file in a 'safe' folder route, then the variable that you need to set is...

UGII_THREADED_HOLE_STANDARD_DIR=<full path to the 'safe' folder>

You will need to restart NX after setting this variable. Also, if you were to put this variable in either the system profile or the user's profile, this will automatically keep NX connected to the modified file even if you were to install a new version of NX.

Anyway, take a look and see if this now works as you would like it to. I've tested all the sizes so it should work for you.


John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
 http://files.engineering.com/getfile.aspx?folder=99e42d84-eac7-41bb-bd4d-cf3d888c954c&file=Automated_UDF.zip
Hey John, I copied the thread data file to the folder you specified and all the new threads are showing up in the threaded hole drop down selection when inserting a hole feature but when I place the udf in a part it seems that Size #1 and #2 appear to work fine but anything larger than those and features in the threaded hole start to disappear. If select the largest size I just get a large hole with no thread features. Any clues what I am doing wrong?

Also I have one other question. Would it be possible todisplay the list of thread sizes (5/16-24, 3/8-20....) from the the Size dropdown rather than a number and then whichever one was selected converted to a number? This would make more sense to the user as to which thread size they were selecting.

Thanks again,
Scott
 
Try switching your display to 'Static Wireframe' and I think you will see that the threaded part of the feature is there.

As for using the thread sizes instead of the numbers, yes it's possible, just that it would have required a rather complex IF statement which would have resulted in those same 13 numeric values anyway since they are what's needed to retrieve the proper values from the various 'List' expressions. But if you would like, I could update the part file and set it up to use the thread sizes instead of the numbers (I could have it by the end of the day if you wish).

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
John, that would be great if you could update the UDF to display the actual thread sizes in the Size drop down box instead of the numbers.

Thanks again for all your help!

Scott
 
OK, here's the updated version of the Part file where the size choice is now a list of Thread Sizes and not simply 1 thru 13. Everything else should work the same as before.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
 http://files.engineering.com/getfile.aspx?folder=460b1ddf-2dfb-47c6-b160-5abe0a5e76fb&file=ES394_NEWEST.prt
Hey John, this is exactly what we were looking for. You're the man! Thanks again for you help on this.

Regards,
Scott
 
Glad you liked it. I hope that you've looked at the model and how I used the 'List' expressions as a sort of 'flat' data-record which can be handy if you have to do something like this in the future where you would like to select a single parameter yet have several other parameters update based on the value of that single selection.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Yes I did and that is a really slick way of handling the dimensional data. I have already identified another similar UDF where I can use this same logic.

Thanks again for all your help.
Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor