1 2 First Previous 18 Replies Latest reply on Sep 25, 2011 6:25 PM by eng.same.tan

    Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??

    eng.same.tan

      Anyone can help me modify or create a stroke for me?

      I tried modify but cannot work, Expedition crash itself. very sad

        • 1. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
          Head1

          Hello Mr. eng.same.tan.

           

              A. Why do you need strokes for Place, Route modes ?

                   You can use Shortcuts already defined inExpedition:

           

                                    Alt + Left arrow  for Place mode

                                    Alt + right arrow for Route mode

                                    Alt + down arrow - guess for what ...

           

             B. If you are in place mode and want to move a part you probably know which

                  stroke to use. looks like this: |\

                  When you are in route mode and want to switch to place mode in order

                  to move a part - do just the same stroke ( |\), and you switch directly to

                  place mode, and you are alredy in move mode.

                  So why  do need to define  place & route  strokes ?

                   Ok, you want to learn. It is never late..

           

             C. Tomorrow , when I will be at work, I will send you some examples of

                  useful strokes I have defined.

           

                              Gruss.

           

                               Head1.

                                          

          • 2. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
            Head1

            Hello Mr. eng.same.tan.

             

                 Attached some  stroke definition. Hope it will help you.

            ' -------------------------------------------------------------------------------

             

            Option Explicit

            Dim My_App       ' The application
            Dim My_Board     ' The Board

            Set My_App = Application
            Set My_Board = My_App.ActiveDocument

            Gui.Bindings("Document").AddStroke "654", "View->Previous View"
            Gui.Bindings("Document").AddStroke "456", "View->Next View"

            Gui.Bindings("Document").AddStroke "65456", "Place->Align Left"

               ' You may guess the other 3 directions.

            ' Run a PROGRAN with a stroke. 
            ' -------------------------------
            Dim KeyBindTables
            Set KeyBindTables=Gui.Bindings("Document")
            KeyBindTables.AddStrokeBinding "74123","Run c:\My_Folder\SOME_PROGRAM.exe", 1

            ' Get doc binding table (Key bindings used when design is open)
              Dim docKeyBindTableObj
              Set docKeyBindTableObj = My_App.Gui.Bindings("Document")

            ' Add the key bindings type library so we can use its enumerates
              Scripting.AddTypeLibrary("MGCSDD.KeyBindings")


            ' Add the new key binding.
              Call docKeyBindTableObj.AddKeyBinding("Ctrl+*", _
              "run C:\My_Folder\SOME_PROGRAM.exe", BindCommand, BindAccelerator)

            ' ---------------------------------------------------------------------------------------------------------------------

             

                      Regards,

             

                      Head1.

             

             

            • 3. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
              eng.same.tan

              @Head1,

              thanks for your reply and sharing tips.

               

              A: Yes, I know there are default stroke keys for those 3 mode.

              I feel that press "ALT" is a extra and to speed up during placement & routing, without pressing "ALT" will be more faster and helpful for me.

               

               

              B: Yes, currently i'm using this stroke (|\) to swith to PLACE mode, but it is directly in MOVE mode, not PLACE mode. Sometime I just want to select parts (like check the properties..etc), so I just to press ESC back to PLACE mode. 

               

               

              To swith to ROUTE mode, I'm using stroke (|, 852), but it is directly to PLOW mode, not ROUTE mode, so when I use this stroke (|, 852), i need to press ESC back to ROUTE mode because I sometime I just want to select trace / via (not all the time want to do the routing)

               

               

              I'm trying to minimize / find a more faster way to switch the mode, I hope you understand.

               

               

               

              C: I got your scripts, but is this vbs or other format? Currectly I'm using the vbs method, how do I use your script on my machine? Appreciate and please advise, thanks.

               

               

              Rgds,

              Sam

              • 4. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                Head1

                Hello Sam,

                 

                  Automation course in short:
                  -----------------------------------------
                  1. To let Expedition  understand the stroke instructions I mentioned
                      in previous answer, please do the following:
                         a. Copy all lines appeared in black, into a text file.
                             You may call it my_strokes.vbs  ( the extension is a must)
                            
                         b. While your application is open, drag  file "my_strokes.vbs"  into the application.
                             You will see nothing, but from this momemt, you can use  the strokes which are defined in the file.
                            
                          This is a primitive way, since whenever you start Expedition application,
                           you must drag the file.
                          
                         There are better methods to achive automation:
                         ----------------------------------------------------------------
                          Whenever an Expedition application is opened, it looks for a file   named : scripts.ini        
                          Here is the format for such a file:
                         
                              [Expedition PCB]
                              Script#0=C:\Sam\my_strokes.vbs
                              Script#1=C:\Sam\my_menu.vbs
                              
                               So,   the second line  is responsible for reading  the file you have dragged before.
                               The   third line  reads  file "my_menu.vbs", which adds menu columns
                               to the main application menu:
                              
                                  File  .. Place .. Route .. Planes  .. can not remembers all of them at home.
                                  
                                  Each new  created sub menu option does an activity by running an .exe  or .vbs file.
                                  This is  in short how it works.
                                 
                                  You my read all this in manual:
                                      pcb_automation_tutorial : Chapters 3 & 4
                                     
                                      How to create menus : Chapter 7
                                     
                                     Programming experience  is needed to understand and
                                     write vbs scripts or  Visual basic programs.
                                    
                         To discourage you :  me it took a lot of time, with programming experience.         
                         To encourage you  :  There are  real programimg experts in this automation forum:
                                                          Kendall Hilles,   John Dune ,  Al leison and Satoru.
                                                                      
                                      Belive me, they know everything you need in programming.
                                     
                                      Till now I got points only for asking questions...
                                      This time - for answering, for the first time.
                                     
                                      All the best and good luck, Sam.
                                     
                                      Head1.
                                     
                                  
                                   
                              
                              
                                
                           
                              
                             

                • 5. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                  eng.same.tan

                  @Head1,

                  OK, I tried your stroke and it is working, thanks.

                   

                  I cannot find the Place/Route/Draw mode under any of the menu (File, edit, view Place, Route, Planes, ECO...etc),

                  so now i plan to add those 3 modes into the "EDIT" menu then only can use stroke to switch among the mode.

                   

                  By the way, where is the pcb_automation_tutorial file? I did a search but cannot get it.

                  Appreciate if you can point me.

                   

                   

                  Rgds,

                  Sam

                  • 6. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                    Head1

                    Hello Sam,

                     

                      Pdf books you can find in folder of  installed Expedition application.

                       Please ask your system manager about this folder. Inside this folder look for ...\docs\pcbdocs.

                       There you will find all books you need and more.

                     

                      Why do you want to define Place, route and draw mode in a menu ?

                      You have all of then in front of your eyes in Standard toolbar.

                      Whenever you open Expedition you see these 3 icons. So why to hide them in a menu ?

                     

                      If you would like to harness key shortcut for them, then the command is:

                     

                         My_app.Gui.ActiveMode = 0  ' Force place mode

                         My_app.Gui.ActiveMode = 1  ' Force route mode

                         My_app.Gui.ActiveMode = 2  ' Force draw mode

                     

                     

                      Please look at previous answers for the format of defining key shortcuts.

                     

                         Regards,

                     

                             Head1.

                    ----------------------------------------------------------------------------------------------------

                     

                    • 7. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                      eng.same.tan

                      @Head1,

                      First of all, I'm really appreciate of your feedback and help me on this topic.

                      BTW, me mysefl, do not familiar with vbs, sorry about this

                       

                      Well, I plan to use stroke to switch the mode instead of clicking the shortcut at the toolbar

                      With these command, can I use stroke to trigger them?

                       

                      My_app.Gui.ActiveMode = 0  ' Force place mode

                      My_app.Gui.ActiveMode = 1  ' Force route mode

                      My_app.Gui.ActiveMode = 2  ' Force draw mode

                       

                       

                      Rgds,

                      Sam

                      • 8. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                        Head1

                        Hello Sam,

                         

                          I did not try the 3  mode commands in .vbs scripts. ( place, route & draw)

                         

                          I checked then in .exe files I wrote in Vb6, and triggered them from an added menu. And they work fine.

                         

                         

                           Regards,

                         

                              Head1.

                        -----------------------------------------------

                         

                        • 9. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                          eng.same.tan

                          Head1,

                          You mean I can write the exe and trigger it from either stroke or shortcut key, right?

                          If yes, I need advise on how to write the exe.

                           

                          Thanks.

                           

                          Rgds,

                          Sam

                          • 10. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                            Head1

                            Hello Sam,

                             

                              You are absolutelly right with your question.

                              

                              Correction. You do not need help in writing an .exe file.

                                                You need a WHOLE COURSE to write Vb programs.

                                                It requires a lot of time to study and a good teacher.

                                                Just  like a  swimming course, It can not be done by email ...

                             

                              I feel the 3 modes issue is very important for you, so I can write  for you an .exe file that does what you dream of.

                              You can trigger it by stroke, key shortcut or menu option.

                             

                               If you send me your email - tomorrow you have the .exe file in yours.

                             

                               head450@gmail.com  - it's me

                             

                             

                                     Regards,

                             

                                            Head1.

                            ----------------------------------------------------------------

                            • 11. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                              eng.same.tan

                              @Head1,

                              Yeah, I agree with you, I need a "big course" .

                              I'm thinking a faster way to trigger the 3 modes while doing on the routing / placement, that's why quite important for me.

                              Maybe this also can help others to speed up the routing / placement process

                               

                              I already send you an email (tes_9xxxx@hormail.com), hope to hear from you soon, thank you very much.

                               

                               

                              Rgds,

                              Sam

                              • 12. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                                Head1

                                Hello Sam,

                                 

                                  1. I did not receive yet  any email from you.

                                  2. I sent the files to:

                                                                              tes_9xxxx@hotmail.com

                                 

                                but  received an error message. There must be an error in address.

                                 

                                    Regards,

                                            Head1.

                                • 13. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                                  eng.same.tan

                                  Hi Head1,

                                  Here is my full email address ==removed my email address===

                                  Let me resend again the email to your gmail.

                                   

                                   

                                  add-on:

                                  Head1,

                                  I already received your exe and vbs files, I tested and they are working perfect.

                                  Thank you very much and really appreciate your work hard & support.

                                   

                                   

                                  Rgds,

                                  Sam

                                  • 14. Re: Modify / Add stroke for  "Place mode", "route mode" and "draw mode"??
                                    peter.kurlak

                                    Head1, can you please send the code to pakman.junk _at_ gmail.com?  Thanks!

                                     

                                    Pete

                                    1 2 First Previous