Creating a threaded hole is achieved with
holePackageBuilder1 = workPart->Features()->CreateHolePackageBuilder(nullNXOpen_Features_HolePackage);
I you create a journal when you create a threaded hole the journal sets the defaults for
Drill Size Hole
Screw Clearance Hole
So the basic journal consists of about 470 lines of code but what you require for threaded hole is included.
Your answer is good in case i want to create a new hole and define the hole to be threaded hole,
but my problem is that i want to define existing hole (feature) to be a threaded hole.
maybe you can help me with that issue?
*I added a screenshot of what i want to do when i record it......the 'Threaded hole' option not marked in green so i cant see the code behind this method
I suggest using the "threaded hole" type option in the hole command rather than adding the thread later with the thread command when possible. The "threaded hole" is better supported by the API.
OK if you want to add a symbolic thread to an existing hole then the best I can do is show you the code I use in VB for the modeling wrapper function.
Dim threaddata As UFModl.SymbThreadData = Nothing threaddata.cyl_face = threadfacetag threaddata.start_face = startfacetag threaddata.axis_direction = threaddirection threaddata.form = threadstandard threaddata.callout = threadcallout threaddata.method = "CUT" threaddata.angle = "60" threaddata.include_instances = UFConstants.UF_MODL_NO_INSTANCES threaddata.rotation = UFConstants.UF_MODL_RIGHT_HAND threaddata.length_flag = UFConstants.UF_MODL_FIXED_LENGTH threaddata.length = threaddepthstring threaddata.tapered = UFConstants.UF_MODL_NON_TAPERED threaddata.num_starts = 1 threaddata.tapped_dia = tapdiastring ufs.Modl.CreateSymbThread(threaddata, threadtag)
Hope this helps.
As you can see in your picture the Thread command does not have a green dot, that marks it as being recordable by a journal.
Therefore it will not be recorded.
However, it can stil be programmed with the method Frank Swinkels is showing you.
Just one further thought. If the existing hole is a hole feature then it is possible to edit the existing hole feature and convert it to a threaded hole using programming.
Thank you for hellping
After a litle research and your's help this are the API'S for converting regular hole to threaded hole are -
Thread creation API:
Thread edit API:
Also there existing example in NX install directory ------>
(very good example)