Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX Journal - Cylinders from CSV File

alj722

Aerospace
Nov 4, 2004
37
I've been pulling what little hair I have left out trying to make an NX Journal to read a CSV file of Pt1X, Pt1Y, Pt1Z, Pt2X, Pt2Y, Pt2Z, Dia and generate a bunch of cylinders to create a trusswork. I've gotten bits and pieces to work (start point, length, diameter), but I can't figure out how to get the direction set. There seems to be a difference between vector3d and direction. I can create a vector but it seems to want a direction and can't find a way to convince it otherwise. I stole this subroutine (which used a DatumAxis and tried to adapt it to a vector without success. An Journal Gurus out there have some tips?

????Function createCyl(ByVal pt3D As Point3D, dia As Double, height As Double, datumAxis1 As DatumAxis)????
????Function createCyl(ByVal pt3D As Point3D, dia As Double, height As Double, direction1 As Direction)????
Dim nullNXOpen_Features_Feature As NXOpen.Features.Feature = Nothing
Dim cylinderBuilder1 As NXOpen.Features.CylinderBuilder
cylinderBuilder1 = workPart.Features.CreateCylinderBuilder(nullNXOpen_Features_Feature)
cylinderBuilder1.BooleanOption.Type = NXOpen.GeometricUtilities.BooleanOperation.BooleanType.Create
cylinderBuilder1.Diameter.RightHandSide = Replace(dia.ToString,",",".")
cylinderBuilder1.Height.RightHandSide = Replace(height.ToString,",",".")
Dim origin1 As NXOpen.Point3d = New NXOpen.Point3d(0.0, 0.0, 0.0)
Dim pt As Point = workPart.Points.CreatePoint(pt3D)
Dim axis1 As NXOpen.Axis
axis1 = cylinderBuilder1.Axis
axis1.Direction = direction1
axis1.Point = pt
Dim nxObject1 As NXObject
nXObject1 = cylinderBuilder1.Commit()
Dim body1 As Body = CType(workPart.Bodies.FindObject(nXObject1.journalidentifier), Body)
cylinderBuilder1.Destroy()
Return body1
End Function
 

Part and Inventory Search

Sponsor