Export image with macro without opening UG session
Export image with macro without opening UG session
(OP)
I'm trying to write a journal that I can run from the command line which will open a part and export an image of the part as a jpg. But I want it to run without having to open a UG window (i.e. run in the background, I don't want to see the parts being processed). I can do this with a journal which I run on an open part in UG using this code:
s.parts.work.ModelingViews.WorkView.RenderingStyle = NXOpen.View.RenderingStyleType.ShadedWithEdges
s.parts.work.ModelingViews.WorkView.orient(nxopen.view.canned.isometric,0)
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.method=1
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.format=0
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.useibl=false
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.generate
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.save("c:\pic.jpg", true)
But if I make a journal which runs this in the background, it doesn't save any images. Is there a way to do what I'm looking for? I'm in NX7.5.
Thanks
s.parts.work.ModelingViews.WorkView.RenderingStyle = NXOpen.View.RenderingStyleType.ShadedWithEdges
s.parts.work.ModelingViews.WorkView.orient(nxopen.view.canned.isometric,0)
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.method=1
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.format=0
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.useibl=false
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.generate
s.parts.work.ModelingViews.WorkView.HiqhQualityImage.save("c:\pic.jpg", true)
But if I make a journal which runs this in the background, it doesn't save any images. Is there a way to do what I'm looking for? I'm in NX7.5.
Thanks





RE: Export image with macro without opening UG session
Images can only be captured while they are being displayed since the Export Image function is simply grabbing that portion of the graphic card's frame buffer which represents the so-called NX 'graphics' window.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum: http://www.plmworld.org/p/cm/ld/fid=209
To an Engineer, the glass is twice as big as it needs to be.
RE: Export image with macro without opening UG session
Thanks.
RE: Export image with macro without opening UG session
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum: http://www.plmworld.org/p/cm/ld/fid=209
To an Engineer, the glass is twice as big as it needs to be.
RE: Export image with macro without opening UG session
OpenSession.Disp.CreateImage(FileTop, UFDisp.ImageFormat.Jpeg, UFDisp.BackgroundColor.White)
RE: Export image with macro without opening UG session
OpenSession.Disp.CreateImage(FileTop, UFDisp.ImageFormat.Jpeg, UFDisp.BackgroundColor.White)
sorry, didn't post the entire thing