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!

Create Datum Plane Using Simple NX Application Programming (SNAP) 1

Status
Not open for further replies.

aeromb1985

Mechanical
Feb 5, 2013
7
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
 
Replies continue below

Recommended for you

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
 
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.
 
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:

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

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

[tt]' 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)[/tt]

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.
 
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.
 
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



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor