本文整理汇总了C#中Selection.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# Selection.Copy方法的具体用法?C# Selection.Copy怎么用?C# Selection.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection.Copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveSurfaceAndFixedPoints
internal string SaveSurfaceAndFixedPoints(ref List<double[]> FixedPoints, ref double[] oPlane)
{
string StlPath= System.IO.Path.GetTempPath() + "STLFileBlankCalculator"; ;
oPartDoc = (PartDocument)CATIA.ActiveDocument;
oSel = oPartDoc.Selection;
oSpa = (SPAWorkbench)oPartDoc.GetWorkbench("SPAWorkbench");
FixedPoints = new List<double[]>();
oSel.Clear();
oSel.Add(SelectSurface("Selecione qual a superficie que pretende planificar. Esc para sair."));
oSel.Copy();
oSel.Clear();
PartDocument NewPart = (PartDocument)CATIA.Documents.Add("Part");
NewPart.Selection.Clear();
NewPart.Selection.Add(NewPart.Part);
NewPart.Selection.PasteSpecial("CATPrtResultWithOutLink");
if (System.IO.File.Exists(StlPath + ".stl")) {
System.IO.File.Delete(StlPath + ".stl");
}
NewPart.Selection.Clear();
NewPart.Part.Update();
CATIA.DisplayFileAlerts = false;
NewPart.ExportData(StlPath, "stl");
NewPart.Close();
CATIA.DisplayFileAlerts = true;
object[] Vec = new object[3];
oSel.Clear();
Reference Ref1 = SelectPoint("Selecione o conjunto de pontos fixos. Esc para sair.");
oSel.Clear();
if (Ref1 == null) Environment.Exit(0);
oSpa.GetMeasurable(Ref1).GetPoint(Vec);
FixedPoints.Add(new double[] { (double)Vec[0], (double)Vec[1], (double)Vec[2] });
do {
Ref1 = SelectPoint("Selecione o conjunto de pontos fixos (" + FixedPoints.Count + " selecionados). Esc para terminar.");
oSel.Clear();
if (Ref1 == null) break;
oSpa.GetMeasurable(Ref1).GetPoint(Vec);
FixedPoints.Add(new double[] { (double)Vec[0], (double)Vec[1], (double)Vec[2] });
} while (true);
if(FixedPoints.Count==0) Environment.Exit(0);
oSel.Clear();
oPartDoc.Part.Update();
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(500);
Vec = new object[9];
Reference Ref2 = SelectPlane("Selecione qual o plano do planificado. Esc para terminar.");
oSel.Clear();
oSpa.GetMeasurable(Ref2).GetPlane(Vec);
oPlane = new double[] { (double)Vec[0], (double)Vec[1], (double)Vec[2],
(double)Vec[3], (double)Vec[4], (double)Vec[5],
(double)Vec[6], (double)Vec[7], (double)Vec[8] };
return StlPath + ".stl";
}