コード例 #1
0
        public override void OnActivate()
        {
            base.OnActivate();
            _fileDialog = new SaveFileDialog {
                Filter = @"*.step|*.step"
            };
            var result = _fileDialog.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                BackToNeutralModifier();
                return;
            }
            var entities =
                Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetEntities).Get
                <List <SceneSelectedEntity> >();

            var nodes         = entities;
            var selectedNodes = new List <TopoDSShape>();

            foreach (var entity in nodes)
            {
                var shapeInterpreter = entity.Node.Get <TopoDsShapeInterpreter>();
                if (shapeInterpreter != null)
                {
                    selectedNodes.Add(shapeInterpreter.Shape);
                }
            }

            NodeBuilderUtils.IdentifySelectedObjectLabel(Document.Root);
            if (selectedNodes.Count != 0)
            {
                MeshTopoShapeInterpreter.SaveShapeToStep(selectedNodes, _fileDialog.FileName);
            }
            else
            {
                SaveCommonCodes.SaveToStep(_fileDialog.FileName, Document);
            }
            BackToNeutralModifier();
        }
コード例 #2
0
 public void ExportToStep(string path)
 {
     SaveCommonCodes.SaveToStep(path, Document);
 }