|
我是用批处理进行调用的,调用方法如下:
6 c0 b A8 l7 K3 r0 `run_journal journal.cs: s/ J i9 x3 ?
其中journal.cs里的内容就是我想进行的操作。如下:) d q$ }& W. W9 J( }3 r' ?
Session theSession = Session.GetSession();
5 L/ F8 |/ L3 @8 Z( c; c, T* Q UFSession theUFSession =UFSession.GetUFSession();/ Y' p+ M4 \* b* A2 I7 N m
PartLoadStatus partLoadStatus1;
$ w: j' e6 h- U% N! @ BasePart basepart1 = theSession.Parts.OpenBaseDisplay("F:\\aaa\\_model1.prt", out partLoadStatus1);# @; b* m; h6 b7 N- c- O
Part workPart = theSession.Parts.Work;
. L! s2 a, s/ N5 Z) Q Part displayPart = theSession.Parts.Display;4 e9 ~+ {* B0 X7 Y, J# C! \% Q" B
partLoadStatus1.Dispose();8 y% l$ u9 u* m- @
//theUFSession.Disp.CreateImage( "F:\\aaa\\a.PNG",UFDisp.ImageFormat.Png, UFDisp.BackgroundColor.White);) C/ Q" c C; B
workPart.ModelingViews.WorkView.HiqhQualityImage.Method = ModelingViewHighQualityImage.ShadeMethod.PhotoRealistic;7 q% _0 H2 R& b
theSession.Preferences.HighQualityImageVisualization.SetImageSize(NXOpen.Preferences.SessionVisualizationHighQualityImage.ImageSizeType.FillView, 1129, 351);: h Z9 H# P, a7 [8 x
workPart.ModelingViews.WorkView.HiqhQualityImage.Generate();
J8 k F3 G K) N, H, k& r workPart.ModelingViews.WorkView.HiqhQualityImage.Save("F:\\aa\\nihao.tif",false);$ Q) w4 \3 l6 Y) _9 H- l( }
8 s, {' `3 y! r- P: k \
t: N+ q5 h* ^" X6 j" W目的是想保存一个图片出来,可是运行没有错误,但是出不来图片,不知道为什么(通过界面按钮执行这个cs文件是可以出图的),求大神指教。% g( d* V, u$ ^: g+ H! a8 J
我的目的就是想保存一张图片出来,有别的方法也可。/ u$ l( K! b4 t7 |
|
|