×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Create Datum Plane Using Simple NX Application Programming (SNAP)

Create Datum Plane Using Simple NX Application Programming (SNAP)

Create Datum Plane Using Simple NX Application Programming (SNAP)

(OP)
Until now, I used to GRIP for programming modeling in NX. Now I want to start using SNAP.
As I am new in SNAP, I can not create any Plane or Datum Plane with SNAP.
I am using NX 8.5
Can you help me?

Regards

RE: Create Datum Plane Using Simple NX Application Programming (SNAP)

I believe the command is PLANE/ DatumPlane( ).

This is from the document "SNAP and NX Open for GRIP Users"

The GRIP PLANE command creates a plane object. Plane objects are infinite in extent, and do not form part of a body.
They are typically used as reference objects — for example a plane might be used for mirroring, or to specify the
location of a cross-section.

In SNAP, there are two corresponding objects: Snap.NX.DatumPlane, and Snap.Geom.Surface.Plane. A Datum Plane
serves roughly the same purpose as a plane object, but Datum Planes are features that are linked to their parent
objects. A Geom.Surface.Plane is a non-persistent object that is not stored in an NX model and exists only within a
SNAP program. In SNAP, each curve has a Plane property which gives the plane containing the curve (if the curve is
planar).

If you really want to create the same kind of object as the GRIP PLANE command, you should use the NX Open
function NXOpen.UF.UFModl.CreatePlane

Mark Rief
NX CAM Customer Success
Siemens PLM Software

RE: Create Datum Plane Using Simple NX Application Programming (SNAP)

(OP)
Dear Rief
Thank you for your reply.
To create a datum plane using GRIP, parallel to XY Plane (with 1 mm distance) it needs just to write
pl01 = PLANE/XYPLAN, 1
But in SNAP I am completely confused. I don't know how can I write it’s command.

Can you write this command here?
for example
PL01 = Snap.NX.DatumPlane(XYPLAN, 1)
or
PL01 = NXOpen.UF.UFModl.CreatePlane

Why SNAP is very confusing and complex? I think GRIP is better while it seems NX support SNAP more than GRIP.

RE: Create Datum Plane Using Simple NX Application Programming (SNAP)

If you have experience with GRIP, and no experience with SNAP, then SNAP will seem more difficult, for a while. But here are some nice things that SNAP and NX/Open give you:

  • Writing code by recording journals
  • Creating modern block-based user interfaces (and without using Block Styler, if you want)
  • Creating more flexible user interfaces using Windows forms
  • Performance — SNAP and NX Open code is orders of magnitude faster than GRIP code
  • Better development tools (like Visual Studio) — “the code writes itself ”
  • Freedom from size limitations (length of names, arrays, strings, etc.)
  • Simpler development — just edit and run (in the Journal Editor) — no need to compile or link
  • More flexible code organization — no need to put every subroutine in a separate file
  • A huge assortment of tools in the .NET framework
  • Creation of newer features, like Datum Planes, Thicken, TrimBody, etc.
  • Easy access to Excel and other Office apps
  • Better handling of text files (using .NET read/write functions)
  • Development of main-stream programming skills that will be useful beyond the world of NX


Anyway, difficult or not, here is code to do what you want

' Create a Datum Plane feature with origin at (0,0,1), parallel to the XY plane
Dim p1 As NX.DatumPlane = Snap.Create.DatumPlane({0,0,1}, Orientation.Identity)

' Create a Geom plane normal to the vector {0,0,1} at distance = 1 from origin
Dim p2 As New Snap.Geom.Surface.Plane({0,0,1}, 1)

' Create a Geom plane with equation 0*x + 0*y + 1*z = 1
Dim p3 As New Snap.Geom.Surface.Plane(0,0,1,1)


The first one creates a Datum Plane feature. The second and third create temporary Geom.Surface.Plane objects. If you tell us what you're going to do with the plane, then we can help you decide which one you should use.

RE: Create Datum Plane Using Simple NX Application Programming (SNAP)

I forgot to mention ... if you know GRIP and want to learn SNAP and NX/Open, there's a new document that came with NX10. It's a PDF file called "SNAP and NX Open for GRIP Enthusiasts". You'll maybe find it helpful.

RE: Create Datum Plane Using Simple NX Application Programming (SNAP)

(OP)
Thank you very much BubbaK

I have a new problem with SNAP
I want to create a circle that is tangent to tree lines with a code in SNAP.
I can not do it. I write my code here. Can anyone help me?
I am using NX 8.5.
Thank you

Option Explicit Off
Imports miniSnap, miniSnap.Create

Module SnapSample
Sub Main()

Dim pA1, pA2, pB1, pB2 As Position
PA1 = { 000 , 0 , 0}
PA2 = { 300 , 0 , 0}
Dim LinA As NX.Line = Line(pA1, pA2)

PB1 = { 000 , 150 , 0}
PB2 ={ 200 , 250 , 0}
Dim LinB As NX.Line = Line(pB1, pB2)
Dim LinC As NX.Line = Line(pA1, pB1)

End Sub
End Module



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources