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!

NXOpen: Replacement for deprecated NXOpen.UF.UFDisp.CreateImage function

Status
Not open for further replies.

Csaba Solyom

Mechanical
Sep 22, 2016
14
0
0
RO
Hello,

I'm currently using the UFDisp.CreateImage function to export some basic screenshots of components, and noticed it says DEPRECATED on the NXOpen .NET Reference Guide (Link to documentation).

We are using NX1919 and NX2027, and in both of these versions this function still works correctly. I just don't know whether it will keep working in any future version, as I can't find documentation about this deprecation (in what NX version, and what is the replacement).

Can anyone give me ideas, what is a good replacement method for this function (in case we'll need to do that in the future)?

Code snippet:
Code:
theUFSession.Disp.CreateImage("C:\\Testfolder\\test\\testimage.png",UFDisp.ImageFormat.Png,UFDisp.BackgroundColor.White);

Thanks,
Csaba
 
Replies continue below

Recommended for you

Yeah, UF_DISP_create_image got retired. Use NXOpen.Gateway.ImageExportBuilder instead.

Yeah, the search function is crap, you have to guess it starts with "image".

Retired functions in NXOpen are placed on "death watch" into uf_retiring.h Once there, they can disappear at any time, but are typically held there for decades. UF_DISP_create_image is actually still around in its "retirement home" as of 2306. It's still a good idea to switch away from these functions as they do disappear from time to time.


Secret tip: Record a journal while performing the desired function over the NX UI, see what it spits out, work with that.
 
@Bleaker

Thanks, I integrated this method into my journal.

Also thanks for reminding me I can record journals... Until recently I only worked with CATIA, when I started with NX I used the record macro function, saw it spit out useless data, and promptly forgot after that in NX journal and macro are two different things.
 
Yes, the macro function only records mouse clicks and key presses, whereas the journal actually builds a working program from that. Journals are still extremely verbose due to droolproofing, I guess, so you have to cut though a lot to get to what you need, but they're an invaluable tool for getting working code samples for most functions.
 
Status
Not open for further replies.
Back
Top