Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

parametric line equation in vb 2

Status
Not open for further replies.
Replies continue below

Recommended for you

avi19:

The easiest way to discover code required for NX Modeling tasks is to:

a. Turn on Journal recording.
Pre-Ribbon UI: Tools --> Journal --> Record​
Ribbon UI: Developer (Tab) --> Journal (Group) --> Record (button)​

b. Give your new journal file a name and save it in a convenient location.

c. Perform the NX operation for which you want to create code. (In your case, drawing a line...)

d. Stop the Journal recording.
Pre-Ribbon UI: Tools --> Journal --> Stop Recording​
Ribbon UI: Developer (Tab) --> Journal (Group) --> Stop Recording (button)​

e. Open the journal file, and observe the code.

You can always search for things in the NX Open API Documentation, but just recording a Journal is almost always faster. :)

Oh... and remember that you can choose to record your Journal in VB, C#, Java, or C++, depending on your programming language of choice. (Tweak this setting in the UI Preferences dialog.)

Does that help?

Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
 
thank you!!!!!!!!!!

all i want to do is construct a whole geometry(Art Designs) and i want to perform scale , rotate , translate etc operations about a point. please tell me the way to do it. journal recording is the way but i want to make it generalized so having a general code will be better i think.....
 
Suppose you have a line with parametric equation P(t) = (1 - t)*P0 + t*P1. In other words, your line starts at the point P0 = (x0,y0,z0) and ends at the point P1 = (x1,y1,z1).

The VB code to create (and draw) a line using NX/Open functions is:

Code:
Dim p0 As New NXOpen.Point3d(x0,y0,z0)
Dim p1 As New NXOpen.Point3d(x1,y1,z1)
Dim myLine As NXOpen.Line = workPart.Curves.CreateLine(p0, p1)

If you use SNAP functions, it's a bit easier. The VB code is just:

Code:
Dim myLine As Snap.NX.Line = Snap.Create.Line(x0,y0,x1,y1)

 
Status
Not open for further replies.
Back
Top