Exemple #1
0
        public void didLoadPcb()
        {
            _swModel = SwApp.NewDocument(@"C:\ProgramData\SolidWorks\SolidWorks 2012\templates\gost-assy.asmdot", 0, 0, 0);
            SwApp.ActivateDoc2("Assembly1", false, _longstatus);
            _swModel = SwApp.ActiveDoc;

            SwAssy = (AssemblyDoc)_swModel;
            SwApp.OpenDoc6(@"C:\Certificate\plata.SLDPRT", 1, 0, "", _longstatus, _longwarnings);
            SwAssy.AddComponent(@"C:\Certificate\plata.SLDPRT", Length / 2, Height / 2, -Width / 2);
        }
Exemple #2
0
        public void didLocateElement(ILibrary selectedItem, Helpers.Action action, int coordinatorX, int coordinatorY, string textboxHeight)
        {
            double height = Convert.ToDouble(textboxHeight) / 1000;
            double coX    = Convert.ToDouble(coordinatorX) / 1000;
            double coY    = (-1) * Convert.ToDouble(coordinatorY) / 1000;

            if (action == Action.Move)
            {
                _swModel.Extension.SelectByID2("", "FACE", _oldX, height + selectedItem.HeightIncrementor, _oldY, false, 0, null, 0);
                _swModel.EditDelete();
            }
            SwApp.OpenDoc6(@"C:\Certificate\ASVMP.SLDPRT", 1, 0, "", _longstatus, _longwarnings);
            SwAssy.AddComponent(@"C:\Certificate\ASVMP.SLDPRT", coX, height + selectedItem.HeightIncrementor, coY);

            _oldX = coX;
            _oldY = coY;
        }