zoukankan      html  css  js  c++  java
  • Solidworks API中在一个拉伸的矩形的前后面建立两个基准面的代码示例

     '建立装配基准面
            '建立Top Plane
            boolstatus = swDoc.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 0, Nothing, 0)
            myRefPlane = CType(swDoc.FeatureManager.InsertRefPlane(8, 0, 0, 0, 0, 0), RefPlane)
            boolstatus = swDoc.Extension.SelectByID2("Plane1", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
            boolstatus = swDoc.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "RefTopPlane")
            swDoc.ClearSelection2(True) '此行代码保留
            '建立Bottom Plane 保留z轴空间坐标尺寸
            boolstatus = swDoc.Extension.SelectByID2("", "FACE", 0, 0, txt_M_I_Thickness.Text / 1000, True, 0, Nothing, 0)
            myRefPlane = CType(swDoc.FeatureManager.InsertRefPlane(8, 0, 0, 0, 0, 0), RefPlane)
            boolstatus = swDoc.Extension.SelectByID2("Plane2", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
            boolstatus = swDoc.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "RefBottomPlane")
            '选择基准面并隐藏
            boolstatus = swDoc.Extension.SelectByID2("RefTopPlane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
            boolstatus = swDoc.Extension.SelectByID2("RefBottomPlane", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
            boolstatus = swDoc.Extension.SelectByID2("RefBottomPlane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
            swDoc.BlankRefGeom()
            '保存文件
            longstatus = swDoc.SaveAs("d:lsolation Plate.SLDPRT")
            swApp.CloseDoc("lsolation Plate.SLDPRT")

    在这里要注意的是当建立第二个面的时候要选择后面并在前面的拉伸高低值付给: 

    boolstatus = swDoc.Extension.SelectByID2("", "FACE", 0, 0, txt_M_I_Thickness.Text / 1000, True, 0, Nothing, 0)

    如果 txt_M_I_Thickness.Text / 1000 的值 =0的话就会产生建的连个基准面都在top面上

      

  • 相关阅读:
    GMap.NET 随谈
    Chrome Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101
    Java 自定义枚举
    如何得到全国省市经纬度范围
    Jquery formwizard 入门 【前台 向导功能】
    Eclipse Juno 安装 Aptana 3.3,支持jquery智能提示
    Ant学习【实践1】
    euerka总结 当幸福来敲门
    Spring Boot 热启动插件 当幸福来敲门
    ASP.NET 2.0 Provider Model 详细分析
  • 原文地址:https://www.cnblogs.com/frankwu2014/p/3650110.html
Copyright © 2011-2022 走看看