Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NXOpen Help!!!

Status
Not open for further replies.

Barnon

Mechanical
Jul 23, 2016
97
I'm having a lot of trouble finding documentation that clearly explains input for functions. For example the NXOpen.Features.HelixBuilder. I created the code below with the help of the recorder and it works, but I can't find any documentation on how to input a value to "SizeLaw" for example you have to write it as "helixBuilder1.SizeLaw.Value.RightHandSide = r1*2"

The documentation section below has the most I could find:

''''''''''''''''Create Helix''''''''''''''''''''''''''
Dim nullNXOpen_Features_Helix As NXOpen.Features.Helix = Nothing
Dim helixBuilder1 As NXOpen.Features.HelixBuilder = Nothing
helixBuilder1 = workPart.Features.CreateHelixBuilder(nullNXOpen_Features_Helix)

helixBuilder1.SizeLaw.Value.RightHandSide = r1*2
helixBuilder1.PitchLaw.Value.RightHandSide = "15"
helixBuilder1.EndLimit.Expression.RightHandSide = "1"

Dim myHelix As NXOpen.NXObject = Nothing
myHelix = helixBuilder1.Commit()

The recorded journal BTW had 10X the number of lines. I just kept deleting them and making sure it still ran.
 
Replies continue below

Recommended for you

The SizeLaw.Value is an expression object. The .RightHandSide (formula) for the expression is entered as a string. This article shows how to create various types of expressions (including simple values and formulas). The code is in VB, but the process is the same in Python.

www.nxjournaling.com
 
I now have a problem with a Datum Plane I created in the Attached Journal. It looks fine but when I use it to mirror the Helix I get unexpected results. Part file attached. (Had some trouble attaching 2 files, so I just copied and pasted the links)

Clipboard01_mk0anr.jpg
 
I fixed the problem by creating the Datum with the code below. Still not sure why the other creation method produced the issue but I'm moving on.

Dim wcsMatrix As NXOpen.Matrix3x3 = workPart.WCS.CoordinateSystem.Orientation.Element
Dim myPlane As NXOpen.DatumPlane = workPart.Datums.CreateFixedDatumPlane(CenterPt, wcsMatrix)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor