private List <SketchLine> contourSegmentLine = new List <SketchLine>(); //轮廓的草图线段 #endregion public Manifold(SldWorks swApp, Sketch basicSketch) { this.swApp = swApp; this.basicSketch = basicSketch; runnerSegments = basicSketch.GetSegmentLine(swApp); gateArcs = basicSketch.GetSegmentArc(swApp); #region 1.从Sketch中获得流道直径 for (int i = 0; i < gateArcs.Count; i++) { runnerDiameter = gateArcs[i].GetRadius() * 2; series = (int)(Math.Round(runnerDiameter * 1000)); gatePoints.Add(new Point(gateArcs[i].GetCenterPoint2())); } #endregion #region 2.设置或获取SW Global Variable。单位是mm,主意转换! swApp.SetGlobalVariable("RunnerDiameter", runnerDiameter * 1000); swApp.SetGlobalVariable("Series", series); maniInsert = swApp.GetGlobalVariableValue("ManiInsert", maniInsert * 1000) / 1000; maniW = swApp.GetGlobalVariableValue("ManiW", maniW * 1000) / 1000; maniH = swApp.GetGlobalVariableValue("ManiH", maniH * 1000) / 1000; #endregion }