马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
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.几的误差,不知为何,请问有没有达人知道该如何解决....
|