Beispiel #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (robot.Name != textBox.Text && oAsmCompDef != null && robot != default(Robot))
            {
                lod_master.Activate();
                robot = new Robot(textBox.Text, oAsmCompDef);

                if (addbaselinkcheckbox.IsChecked == true)
                {
                    addbaselink(ref robot, oAsmCompDef);
                }
            }

            string folder = GetFolder();

            Directory.CreateDirectory(folder);
            Directory.CreateDirectory(folder + "\\urdf");
            robot.WriteURDFFile(folder + "\\urdf\\" + robot.Name + ".urdf");
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            //Change to simple version for meshes
            LevelOfDetailRepresentation lod_simple = repman.LevelOfDetailRepresentations["Collision"];

            lod_simple.Activate();

            Directory.CreateDirectory(Directory.GetCurrentDirectory() + "\\meshes");
            robot.WriteSTLFiles(Directory.GetCurrentDirectory() + "\\meshes");

            lod_master.Activate();
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (_invApp.Documents.Count == 0)
            {
                // Create an instance of the open file dialog box.
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter      = "Inventor assembly (.iam)|*.iam|All Files (*.*)|*.*";
                openFileDialog1.FilterIndex = 1;
                openFileDialog1.Multiselect = false;

                // Call the ShowDialog method to show the dialog box.
                DialogResult dialogResult = openFileDialog1.ShowDialog();

                // Process input if the user clicked OK.
                if (dialogResult == DialogResult.OK)
                {
                    _invApp.Documents.Open(openFileDialog1.FileName);
                }
                else
                {
                    _invApp.Documents.Open("D:\\Workspace\\AutoTurf4_CAD\\Version 4 - Komplet maskine.iam");
                }
            }

            oUOM        = _invApp.ActiveDocument.UnitsOfMeasure;
            oAsmDoc     = (AssemblyDocument)_invApp.ActiveDocument;
            oAsmCompDef = oAsmDoc.ComponentDefinition;

            //Change to master version for massproperties and joints
            repman     = oAsmCompDef.RepresentationsManager;
            lod_master = repman.LevelOfDetailRepresentations["Master"];
            lod_simple = repman.LevelOfDetailRepresentations["Collision"];

            lod_master.Activate();
            robot = new Robot(oAsmDoc.DisplayName, oAsmCompDef);

            textBox1.Text = oAsmDoc.DisplayName;

            dataGridView1.AutoGenerateColumns         = false;
            dataGridView2.AutoGenerateColumns         = false;
            dataGridView1.DataSource                  = robot.Links;
            dataGridView1.Columns[0].DataPropertyName = "Name";
            dataGridView1.Columns[1].DataPropertyName = "Inertial";
            dataGridView2.DataSource                  = robot.Joints;
            dataGridView2.Columns[0].DataPropertyName = "Name";
            dataGridView2.Columns[1].DataPropertyName = "JointType";
            dataGridView2.Columns[2].DataPropertyName = "Origin";
            dataGridView2.Columns[3].DataPropertyName = "Axis";
            dataGridView2.Columns[4].DataPropertyName = "Parent";
            dataGridView2.Columns[5].DataPropertyName = "Child";
        }
Beispiel #4
0
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            if (_invApp.Documents.Count == 0)
            {
                // Create an instance of the open file dialog box.
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter      = "Inventor assembly (.iam)|*.iam|All Files (*.*)|*.*";
                openFileDialog1.FilterIndex = 1;
                openFileDialog1.Multiselect = false;

                // Call the ShowDialog method to show the dialog box.


                // Process input if the user clicked OK.
                if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    _invApp.Documents.Open(openFileDialog1.FileName);
                }
                else
                {
                    _invApp.Documents.Open(Properties.Settings.Default.autoload_file);
                }
            }

            oUOM        = _invApp.ActiveDocument.UnitsOfMeasure;
            oAsmDoc     = (AssemblyDocument)_invApp.ActiveDocument;
            oAsmCompDef = oAsmDoc.ComponentDefinition;

            //Change to master version for massproperties and joints
            repman     = oAsmCompDef.RepresentationsManager;
            lod_master = repman.LevelOfDetailRepresentations["Master"];

            lod_master.Activate();
            robot = new Robot(oAsmDoc.DisplayName, oAsmCompDef);

            if (addbaselinkcheckbox.IsChecked == true)
            {
                addbaselink(ref robot, oAsmCompDef);
            }

            textBox.Text = oAsmDoc.DisplayName.TrimEnd(".iam".ToCharArray());

            dataGridLinks.DataContext  = robot.Links;
            dataGridJoints.DataContext = robot.Joints;

            dataGridLinks.ItemsSource  = robot.Links;
            dataGridJoints.ItemsSource = robot.Joints;
            dataGridLinks.Items.Refresh();
            dataGridJoints.Items.Refresh();
        }
Beispiel #5
0
        private void button_Copy_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                lod_simple = repman.LevelOfDetailRepresentations["Collision"];
                lod_simple.Activate();
            }
            catch
            {
                System.Windows.MessageBox.Show("There is no collision LevelOfDetail available, will export meshes from Master LOD");
            }
            //Change to simple version for meshes

            string folder = GetFolder();

            Directory.CreateDirectory(folder);
            Directory.CreateDirectory(folder + "\\meshes");
            robot.WriteSTLFiles(folder + "\\meshes");

            lod_master.Activate();
        }