Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Journal - AskPointContainment 1

Status
Not open for further replies.

kukelyk

Industrial
Mar 21, 2005
315
A small program, a big problem:
Code:
Option Strict Off
Imports System
Imports NXOpen
Imports System.IO
Imports NXOpen.UF
Imports NXOpen.ASSEMBLIES
'- - - - - - - - - - - - - - - - - - - - - - 
Module NXJournal

Public theSession As Session = Session.GetSession()
Public theUI As UI = UI.GetUI()
Public theUFSession As UFSession = UFSession.GetUFSession()
Public workPart As NXOpen.Part = theSession.Parts.Work

Sub Main

Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim pointPos as Integer
Dim aPoint As Double()

aPoint(0) = 11
aPoint(1) = 0
aPoint(2) = 12.5

For Each aBody As Body In workPart.Bodies 
Dim a as integer = theUFSession.Modl.AskPointContainment (aPoint, aBody.Tag, pointPos )
Next  
End Sub
End Module
error message: "Expression does not produce a value"

From the reference guide:
Returned status of the point on the body
1 = point is inside the body
2 = point is outside the body
3 = point is on the body
What is it?


----
kukelyk
 
Replies continue below

Recommended for you

In your example, the returned value is the pointpos variable. In many of the UF functions you must supply variables for both input and output values, in this case aPoint and aBody.Tag are the inputs and pointPos is the output.

Code:
[COLOR=#CC0000][s]Dim a as integer =[/s][/color] theUFSession.Modl.AskPointContainment (aPoint, aBody.Tag, pointPos )

www.nxjournaling.com
 
I am an absolute beginner in programing...Thanks again

----
kukelyk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor