private void exportIgesToolStripMenuItem_Click(object sender, EventArgs e) { SceneManager sceneManager = renderView.SceneManager; TopoShapeGroup group = new TopoShapeGroup(); for (ElementId ii = mBeginId; ii < mEndId; ++ii) { SceneNode node = sceneManager.FindNode(ii); if (node != null) { TopoShapeGroup shapeGroup = GlobalInstance.TopoShapeConvert.ToTopoShape(node); if (shapeGroup != null) { for (Int32 jj = 0, len = shapeGroup.Size(); jj < len; ++ii) { TopoShape shape = shapeGroup.GetTopoShape(jj); Matrix4 trf = GlobalInstance.MatrixBuilder.MakeRotation(90, Vector3.UNIT_X); shape = GlobalInstance.BrepTools.Transform(shape, trf); group.Add(shape); } } } } if (group.Size() > 0) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "IGES File (*.igs;*.iges)|*.igs;*.iges"; if (DialogResult.OK != dlg.ShowDialog()) { return; } TopoDataExchangeIges igsWriter = new TopoDataExchangeIges(); igsWriter.Write(group, new AnyCAD.Platform.Path(dlg.FileName)); } else { MessageBox.Show("No shape to save!"); } }
private void exportIgesToolStripMenuItem_Click(object sender, EventArgs e) { SceneManager sceneManager = renderView.SceneManager; TopoShapeGroup group = new TopoShapeGroup(); for (ElementId ii = mBeginId; ii < mEndId; ++ii) { SceneNode node = sceneManager.FindNode(ii); if (node != null) { TopoShape shape = GlobalInstance.TopoShapeConvert.ToTopoShape(node); if (shape != null) { Matrix4 trf = GlobalInstance.MatrixBuilder.MakeRotation(90, Vector3.UNIT_X); shape = GlobalInstance.BrepTools.Transform(shape, trf); group.Add(shape); } } } if (group.Size() > 0) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "IGES File (*.igs;*.iges)|*.igs;*.iges"; if (DialogResult.OK != dlg.ShowDialog()) { return; } TopoDataExchangeIges igsWriter = new TopoDataExchangeIges(); igsWriter.Write(group, new AnyCAD.Platform.Path(dlg.FileName)); } else { MessageBox.Show("No shape to save!"); } }