几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】how to use getsectionedbody90 funtion (http://www.dimcax.com/hust/showthread.php?t=4505)

yang686526 2009-04-12 06:40 PM

【转帖】how to use getsectionedbody90 funtion
 
how to use getsectionedbody() funtion
hi all,
now, i'm studing about solidwork api. this is my problem, if you can, please answers for me
c#:
modeldoc2 doc = (modeldoc2)this.iswapp.activedoc;
modelview view = (modelview)modedoc.activeview;
selectionmgr selectmgr = (selectionmgr)modedoc.selectionmanager;
bool status = modedoc.extension.selectbyid2("???", "plane", 0, 0, 0, true, 1, null, 0);
sectionviewdata viewdata = modedoc.modelviewmanager.createsectionviewdata();
feature obj = (feature)objselectmgr.getselectedobject6(2, -1);
viewdata.firstplane = (object)obj;
viewdata.firstoffset = 0.0;
viewdata.firstreversedirection = false;
viewdata.firstrotationx = 0.0;
viewdata.firstrotationy = 0.0;
viewdata.firstcolor = 255;
viewdata.showsectioncap = true;
bool resutl = modedoc.modelviewmanager.createsectionview(objviewdata);
body2 body = (body2)doc.getsectionedbody(view);
but why body object allways is null ?
edited: 11/24/2008 at 09:30 pm by xuanson trinh
quick


所有的时间均为北京时间。 现在的时间是 06:25 PM.