Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Coding Journal UF type commands 1

Status
Not open for further replies.

Twullf

Mechanical
Jan 24, 2012
196
I have been attempting to use the UF_DISP_set_display command to turn off the display while journals run, but I cannot get it to work.

I have tried calling

SetDisplay(UF_DISP_SUPPRESS_DISPLAY)

I get:
Name 'UF_DISP_SUPPRESS_DISPLAY' is not declared

I have tried
Dim display_code As Integer
display_code=UF_DISP_SUPPRESS_DISPLAY
SetDisplay(display_code)

I get:
Name 'UF_DISP_SUPPRESS_DISPLAY' is not declared
Reference to a non-shared member requires an object reference.

I have tried
SetDisplay(display_code)

I get:
Name 'display_code' is not declared.

I know I am missing something incredibly basic but I'm not sure what it is or where I should look. I have been all over the NXOpen reference documentation trying to figure this out but I am missing something fundamental.

Thanks in advance for your help.
 
Replies continue below

Recommended for you

UF_DISP_SUPPRESS_DISPLAY is a constant declared in the API. I assume you have added Imports NXOpen.UF at the beginning of your code. If so, you can reference the constant like this:

Code:
UFConstants.UF_DISP_SUPPRESS_DISPLAY

www.nxjournaling.com
 
I have referenced the following at the beginning of the code:
Imports NXOpen.UF
Imports NXOpen.UF.UFDisp

with the following code:
Dim display_code As Integer
display_code = UFConstants.UF_DISP_SUPPRESS_DISPLAY
SetDisplay( display_code )

I get the error:
Reference to a non-shared member requires an object reference.

I got the same error when trying to use the UFConstants line directly instead of using display code.

I have checked to make sure our license allows us access to gateway.

Thanks for the help Cowski.
 
Do you have a reference to the UFSession?

Code:
Dim ufs As UFSession = UFSession.GetUFSession

ufs.Disp.SetDisplay(UFConstants.UF_DISP_SUPPRESS_DISPLAY)
'do stuff

'unsuppress display
ufs.Disp.SetDisplay(UFConstants.UF_DISP_UNSUPPRESS_DISPLAY)

www.nxjournaling.com
 
The program works.

Awesome Cowski as always your advice is excelent.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor