当前位置: 首页 > news >正文

网站建设栏目规划快速生成网站

网站建设栏目规划,快速生成网站,宣传手册设计模板,企业网站背景颜色今天在讲述主要内容之前#xff0c;先说一个不太相关的问题。 我之前在其他文章中看到有一些朋友在问为什么获取到的点位数据需要乘以1000进行单位转换#xff0c;其实原因是这样的#xff0c;在所有使用的API中如果没有特殊说明#xff0c;所有的长度单位都是米#xff…今天在讲述主要内容之前先说一个不太相关的问题。 我之前在其他文章中看到有一些朋友在问为什么获取到的点位数据需要乘以1000进行单位转换其实原因是这样的在所有使用的API中如果没有特殊说明所有的长度单位都是米角度单位都是弧度顺手解答一下那位朋友的疑问。 下面开始今天文章的主题 1、介绍第一个和选择管理器相关的APIGetSelectedObjectCount2 Method (ISelectionMgr) 这个API的解释为获取所选对象的数目。 2、第二个API为GetSelectedObject6 Method (ISelectionMgr) 这个API的解释为获取选择对象这个我平时用的非常多。 下面是使用的例子 public void Main(){ModelDoc2 swModel  default(ModelDoc2);ModelDocExtension swModelDocExt  default(ModelDocExtension);FeatureManager swFeatureManager  default(FeatureManager);MidSurface3 swMidSurfaceFeature  default(MidSurface3);Feature swFeature  default(Feature);SelectionMgr swSelectionMgr  default(SelectionMgr);Face2 swFace  default(Face2);bool status  false;int errors  0;int warnings  0;string fileName  null;int count  0;object[] faces  null;int i  0;fileName  C:\\Users\\Public\\Documents\\SOLIDWORKS\\SOLIDWORKS 2018\\samples\\tutorial\\api\\box.sldprt;swModel  (ModelDoc2)swApp.OpenDoc6(fileName, (int)swDocumentTypes_e.swDocPART, (int)swOpenDocOptions_e.swOpenDocOptions_Silent, , ref errors, ref warnings);swModelDocExt  (ModelDocExtension)swModel.Extension;status  swModelDocExt.SelectByID2(, FACE, -0.0533080255641494, 0.0299999999999727, 0.0131069871973182, true, 0, null, 0);status  swModelDocExt.SelectByID2(, FACE, -0.0370905424398416, 0, 0.0289438729892595, true, 0, null, 0);swFeatureManager  (FeatureManager)swModel.FeatureManager;swFeatureManager.InsertMidSurface(null, null, 0.0, false);status  swModelDocExt.SelectByID2(Surface-MidSurface1, REFSURFACE, 0, 0, 0, false, 0, null, 0);swSelectionMgr  (SelectionMgr)swModel.SelectionManager;swFeature  (Feature)swSelectionMgr.GetSelectedObject6(1, -1);swMidSurfaceFeature  (MidSurface3)swFeature.GetSpecificFeature2();count  swMidSurfaceFeature.GetFaceCount();Debug.Print(Number of faces for midsurface feature:   count);faces  (object[])swMidSurfaceFeature.GetFaces();for (i  faces.GetLowerBound(0); i  faces.GetUpperBound(0); i){swFace  (Face2)faces[i];Debug.Print(Area of face   i   of midsurface feature:   swFace.GetArea());}}/// summary///  The SldWorks swApp variable is pre-assigned for you./// /summarypublic SldWorks swApp;3、第三个API为GetSelectedObjectType3 Method (ISelectionMgr) 这个API的解释为获取选择对象的类型。 下面介绍一个使用的例子 public void Main() { ModelDoc2 swModel default(ModelDoc2); bool boolstatus false; SelectionMgr SelMgr default(SelectionMgr); TableAnnotation theTableAnnotation default(TableAnnotation); int SelObjType 0; int TableAnnotationType 0; swModel (ModelDoc2)swApp.ActiveDoc; SelMgr (SelectionMgr)swModel.SelectionManager; SelObjType SelMgr.GetSelectedObjectType3(1, -1); if (SelObjType ! (int)swSelectType_e.swSelANNOTATIONTABLES) { MessageBox.Show(Select a BOM table in the drawing before running this example.); return; } theTableAnnotation (TableAnnotation)SelMgr.GetSelectedObject6(1, -1); TableAnnotationType theTableAnnotation.Type; if (TableAnnotationType ! (int)swTableAnnotationType_e.swTableAnnotation_BillOfMaterials) { MessageBox.Show(Select a BOM table in the drawing before running this example.); return; } Debug.Print(Table before inserting a column...); // Display table before inserting a column DisplayTableColumnProps(theTableAnnotation); // Insert new column boolstatus theTableAnnotation.InsertColumn2((int)swTableItemInsertPosition_e.swTableItemInsertPosition_Last, 0, New Column, (int)swInsertTableColumnWidthStyle_e.swInsertColumn_DefaultWidth); boolstatus theTableAnnotation.SetColumnType2(theTableAnnotation.ColumnCount - 1, (int)swTableColumnTypes_e.swBomTableColumnType_PartNumber, true); Debug.Print( ); Debug.Print(Table after inserting a column...); // Display table after inserting a column DisplayTableColumnProps(theTableAnnotation); } public void DisplayTableColumnProps(TableAnnotation theTableAnnotation) { int ColCount 0; int i 0; string iString null; int ColType 0; string ColTypeString null; string ColTitle null; Debug.Print(Col# Type   Title); ColCount theTableAnnotation.ColumnCount; for (i 0; i ColCount - 1; i) { ColType theTableAnnotation.GetColumnType2(i, true); ColTypeString System.Convert.ToString(ColType); ColTitle theTableAnnotation.GetColumnTitle2(i, true); iString System.Convert.ToString(i); Debug.Print(iString     ColTypeString   ColTitle); } } /// summary /// The SldWorks swApp variable is pre-assigned for you. /// /summary public SldWorks swApp; 今天介绍的这三个API都是选择管理器相关的API还是比较常用的。 本篇文章就介绍这些我们下篇文章再见。
http://wiki.neutronadmin.com/news/132935/

相关文章:

  • 合肥市建设通网站一个网站的seo优化有哪些
  • 信息网站方案wordpress从新安装
  • 网站开发博客做网站公司做网站公司
  • 建设网站困难的解决办法重庆妇科医院咨询
  • 广州市网站建设 骏域视频网站 建设 硬件
  • 一级a做爰电影片免费网站wordpress 产品列表页
  • 怎么修改wordpress站点代码做旅游景区网站
  • 白银网站建设硬件工程师培训机构哪家好
  • 国外手做网站wordpress加密原理
  • 企业案例网站最新淘宝客网站程序
  • 温州做网站哪家比较好pt网站怎么下载与做
  • 广州 网站制作 网站推广他达拉非片和西地那非片的区别
  • 公司注销的网站备案东莞网站哪家好
  • 做外掛网站空间网站建设指南
  • 仿制网站建设电子工程网稳压器教程
  • 莱山网站建设东莞seo整站优化火速
  • 移动应用开发公司网站模板贵州省遵义市建设局网站
  • 搭建网站步骤wordpress怎么启用sll证书
  • 学校网站建设管理制度班级网站素材下载
  • 手机网站开发教程视频查询企业的软件
  • 代做毕设网站做培训网站哪家好
  • 移动网站用什么建设网站 永久关停 请示
  • 正规的咨询行业网站策划宁波梅山建设局网站
  • 卧龙区网站建设淘宝现在不能发布网站建设
  • 域名转移 网站访问2008年做的网站
  • 数字火币交易网站开发网络服务器可提供的常见服务
  • dede做电影网站南阳网站推广优化公司哪家好
  • 唐山网站建设怎么样望城做网站找谁
  • 免费网站建设培训网站做标准曲线
  • 大气环保网站模板权重2的网站