4 Replies Latest reply on May 6, 2010 2:02 AM by Alpha

    GRID SETTING in Cell Editor

    Alpha

      Hello dear Community member,

      is there any possibility to predefine the grid Setting without using a schema.

       

      We want our grid settings to be loaded as default every time we are opening the cell editor.

      How can we achieve this.

       

      Best Regards.

        • 1. Re: GRID SETTING in Cell Editor
          Andreas.Schaefer

          Hello,

          I would recommend to use automation.

           

          1. Add
            [Cell Editor]

            Script#0=<full path of VBScript file>

            To the scipts.ini file
          2. Use code like
            ' get the license
            set Doc = GetLicensedDoc()
            Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")
            set EC = Doc.EditorControl
            ''--------
            EC.RouteDoubleClickToAddVia = TRUE
            ' Push/shove
            EC.RoutePushAndShove(epcbECTraceShoving) = TRUE
            EC.RoutePushAndShove(epcbECViaShoving) = FALSE
            in you VBScript to configure editor control on start up of the cell editor.

           

          Every youser invoking the cell editor will get the same configuration.

           

          Regards,

          Andreas

          • 2. Re: GRID SETTING in Cell Editor
            Alpha

            Hello Andreas,

             

            first of all thank you for your good idea.

            Now I can do grid setting, per script within Expedition PCB.

            But i want to do the same in Cell Editor.

             

            Problem is:

            1- I need an EditorControl object in order to access the Grid.

            I didn't see any possibility to access the EditorControl Object per script within CellEditor Addin !!

            Have please a look in Cell Editor Data Model in attachement.

             

             

            2- The changes done using EditorControl in Expedition PCB are not update in EditorControl CellEditor, this

            mean the two EditorControl are two differents Object.

             

             

             

            To Acces the EditorControl and change the Grid Setting in Expedition PCB i can do this for example:

            Set Appl_Object = GetObject(, "MGCPCB.Application")
            Set pcbDoc=GetLicensedDoc(Appl_Object)

            pcbDoc.EditorControl.Grid(epcbGridRoute) = "20.0"

            pcbDoc.EditorControl.Grid(epcbGridDrawing) = "38.0"

             

            In Expedition PCB: This  Will change the RouteGrid to 20  and the Drawing Grid to 38.

            Now if i open the Cell Editor and check the grid Setting:( Setup-->EditorControl-->Grids)

            the setting are not the same as those above.

             

             

            Questions:

             

            1-Is it possible to access the EditorControl in CellEditor per Script ? how ?

             

            Best Regards.

            • 3. Re: GRID SETTING in Cell Editor
              Andreas.Schaefer

              Hi,

               

              the Cell Editor you see  in this data model is the Aplication where you can select your cells and so on.

              The GUI "Cell Editor" you are looking for, and where you have an editor Control is and Document object.

               

              But the

              Set Appl_Object = GetObject(, "MGCPCB.Application")
              Set  pcbDoc=GetLicensedDoc(Appl_Object)

               

              will not work here, because the call for the Appl_Object will fail.

               

              Instead you should yust say

              Set Appl_Object =Application

               

              and add the vbs inside the scripts.ini.

              Otherwise you will have to put a code going through all instances of application, to be sure code is executed in the correct expedition.

               

               

              To test it, just write an vbs with code

              Set Appl_Object =Application

              Set  pcbDoc=GetLicensedDoc(Appl_Object)

              pcbDoc.EditorControl.Grid(epcbGridRoute) = "20.0"

              pcbDoc.EditorControl.Grid(epcbGridDrawing)  = "38.0"

               

              and put it on the cell editor window by drag & drop.

               

              So you see, to acces all the data in cell editor you can do it same way as in expedition PCB.

              The only differnce is, how to get the application object and then the document object.

               

              If you don't want to use the above way, you have to replace the first line by Set Appl_Object = GetObject(, "MGCPCB.CellEditorApplication")

              to call for Cell Editor.

              You can find this in the applications objext catalogue.

               

              kind regards,

              Andreas

              • 4. Re: GRID SETTING in Cell Editor
                Alpha

                Hello Andreas,

                My Script working know as expected.

                Your post was very helpfull: Thank you.