示例#1
0
        public void ErzeugeScreenshot(Schraube s)
        {
            // Dateiname festlegen
            string bildname = s.schraubenkopf + " M" + s.metrischeGewindegroesse.bezeichnung + "x" + s.schaftLaenge.schaftlaenge;

            //Standarthintergrung speichern
            object[] arr1 = new object[3];
            hsp_catiaApp.ActiveWindow.ActiveViewer.GetBackgroundColor(arr1);

            // Hintergrung auf weiß setzen
            object[] arr2 = new object[] { 1, 1, 1 };
            hsp_catiaApp.ActiveWindow.ActiveViewer.PutBackgroundColor(arr2);

            // 3D Kompass ausblenden
            hsp_catiaApp.StartCommand("CompassDisplayOff");
            hsp_catiaApp.ActiveWindow.ActiveViewer.Reframe();

            INFITF.SettingControllers settingControllers1 = hsp_catiaApp.SettingControllers;

            // Screenshot wird erstellt und gespeichert
            hsp_catiaApp.ActiveWindow.ActiveViewer.CaptureToFile(CatCaptureFormat.catCaptureFormatBMP, "C:\\Windows\\Temp\\" + bildname + ".bmp");

            // 3D Kompass eingeblendet
            hsp_catiaApp.StartCommand("CompassDisplayOn");

            // Setzt die Hintergrundfarbe auf Standart zurück
            hsp_catiaApp.ActiveWindow.ActiveViewer.PutBackgroundColor(arr1);
        }
示例#2
0
        // Testing Area
        public void test()
        {
            Console.WriteLine("--> start test");

            // Adds a geo set to the active part & zooms all
            INFITF.Editor myEditor;
            myEditor = catia.ActiveEditor;

            MECMOD.Part myPart;
            myPart = (MECMOD.Part)myEditor.ActiveObject;

            MECMOD.HybridBodies hybridBodies1;
            hybridBodies1 = myPart.HybridBodies;

            MECMOD.HybridBody hybridBody1;
            hybridBody1 = hybridBodies1.Add();

            myPart.Update();

            catia.StartCommand("Fit all in");
        }