NXOpen VB.net programs
NXOpen VB.net programs
(OP)
Hi,
I made some GRIP prgms but now I would like to
switch to VB.NET . . .
To start learning I would like to create 1 point on the screen at x=10, y=20, z=30
In GRIP I write it in this way :
ENTITY/PT1
PT1=POINT/10,20,30
My question : How is it write in NXOpen VB.NET
remark : I have VB.NET Express 2010 Framework 4
Thanks very much for your help
I made some GRIP prgms but now I would like to
switch to VB.NET . . .
To start learning I would like to create 1 point on the screen at x=10, y=20, z=30
In GRIP I write it in this way :
ENTITY/PT1
PT1=POINT/10,20,30
My question : How is it write in NXOpen VB.NET
remark : I have VB.NET Express 2010 Framework 4
Thanks very much for your help





RE: NXOpen VB.net programs
RE: NXOpen VB.net programs
Dim ufs As UFSession = UFSession.GetUFSession()
Dim pointTag As NXOpen.Tag = Tag.Null
Dim point1() As Double = {10.0, 20.0, 0.0}
ufs.Curve.CreatePoint(point1, pointTag)
FrankSwinks
RE: NXOpen VB.net programs
I am very novice with VB.NET . . .
Another question:
I tried to put this code into the journal
' NX 6.0.5.3
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim coordinates1 As Point3d = New Point3d(10, 20, 30)
Dim point2 As Point
point2 = workPart.Points.CreatePoint(coordinates1)
point2.SetVisibility(SmartObject.VisibilityOption.Visible)
point2.RedisplayObject()
End Sub
End Module
And it works . . . I am happy
But when I put the same code into VB.NET Express 2010 IDE
At the debugging, I have this error !!!
Unable to load DLL 'libpart': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
The error is on this line : Dim theSession As Session = Session.GetSession()
What's wrong ???
Is there a special configuration to set into the IDE to use it with NX ?
Thank a lot in advance
RE: NXOpen VB.net programs
1. Start NX
2. Start VS with the project you want to debug
3. Create one or more break points in the project
4. In VS choose Debug->Attach to Process...
5. Choose ugraf.exe from the list of processes.
6. In NX start running your project in whatever way you want (eg File->Execute->NX Open)
7. When one of the breakpoints gets reached NX will hang while you step through the code.
8. When you want to stop debugging, in VS choose Debug->Detach All
I find this rather painfull so that when developing programs I typically list out values (using the NX listing window and create points to see how things are going.
By the way the reason I used the wrapper function for creating the point object was to demonstrate it with the minimum number of lines of code.
FrankSwinks
RE: NXOpen VB.net programs
RE: NXOpen VB.net programs
I have a problem accessing any kind of info from a session.
I always get a null ref exception whenever I try to access anything (part etc) from a session....
does anyone have any clue....???????