iCAx开思网

标题: 关于二次开发函数的问题 [打印本页]

作者: 东边wo    时间: 2014-11-22 16:07
标题: 关于二次开发函数的问题
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.Runtime.InteropServices;
using System;

namespace _.csproj
{
    public partial class SolidWorksMacro
    {
        public void Main()
        {
            ModelDoc2 swDoc = null;
            bool boolstatus = false;
            swDoc = ((ModelDoc2)(swApp.ActiveDoc));
            boolstatus = swDoc.Extension.SelectByID2("", "face", 0.05, 0, 0, true, 8, null, 0);//设定孔位置
            Feature myFeature = null;
            myFeature = ((Feature)(swDoc.FeatureManager.HoleWizard3(2, 8, 143, "Ø25.0", 1, 0.025, 0.01, 1, 0,  0, 0, 0, 0, -1, -1, -1, -1, -1, -1, "", false, true, true, true, true, false)));//设定孔参数
            swDoc.ClearSelection2(true);
        }
        /// <summary>
        ///  The SldWorks swApp variable is pre-assigned for you.
        /// </summary>
        public SldWorks swApp;
    }
}

以上是C#的孔特征代码,绿底部分设置孔位坐标(50,0,0),但是实际生成的特征坐标却是浮动的,会产生0.几的误差,不知为何,请问有没有达人知道该如何解决....






欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3