×
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

How to Call NXOpen From KF

How to Call NXOpen From KF

How to Call NXOpen From KF

(OP)
Dear Forum,

I must be doing something wrong here. This shouldn't be a difficult problem. I want to be able to call an NXOpen dll from KF.

Here's my KF code:

@{
$result << nx_ja_session_execute( "C:\Temp\CurvatureAnalysis.dll", "CurvatureAnalysis", "Echo", { "Hello Here I am"} );
ug_printvalues(stringvalue($result));
true ;
};

Here's my NXOpen code:

Option Strict Off
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Utilities
Imports NXOpen.Features

Public Class CurvatureAnalysis

Private theSession As Session
Private theUFsession As UFSession
Private workPart As Part
Private displayPart As Part
Private theUI As UI

Sub Main()

theSession = Session.GetSession()
workPart = theSession.Parts.Work
displayPart = theSession.Parts.Display
theUI = UI.GetUI()
theUFsession = UFSession.GetUFSession()

End Sub

Public Sub Echo(ByVal output As String)

theSession.ListingWindow.Open()
theSession.ListingWindow.WriteLine(output)
theSession.LogFile.WriteLine(output)

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
End Function

End Class

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