Macro

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Macro

    Does anyone know how to run a macro without hitting the "Play" button? Is there any code or basic script that can run a macro in the middle of a programs execution?
    "Your mom goes to college."
    Kip

  • #2
    Like in an excel macro or a script?
    sigpic
    if you had soap on a rope it would be tied to yer ankle

    Comment


    • #3
      Insert > script then give the location of your .bas

      Craig
      <internet bumper sticker goes here>

      Comment


      • #4
        The macro is a *.mac file. It can't be imbedded like a basic script. I looked in the help manual for pcdmis basics, but couldnt' find anything about macros.
        "Your mom goes to college."
        Kip

        Comment


        • #5
          You'll need to run a .bas. Can you save it as a .bas through something like Excell's VB editor (PCDMIS's sucks)? Or is it a macro that automates? In that case you'll need to write an automation script. What does you macro do?

          Here is code for a script that passes a variable to the .bas
          Code:
          CS7        =SCRIPT/FILENAME= C:\COMPORTSCRIPT.BAS
                      FUNCTION/SendToCom,SHOW=YES,COMPORT,FEAT7,,
                      STARTSCRIPT/
                      ENDSCRIPT/
          For whatever reason PCDMIS takes care of the ENDSCRIPT line at execution time so don't worry about that. If you want to pass a variable you need to do it with the function line and the way I see it you can't pass back to PCDMIS but I'm dying to find out you can and how. I have found if you need to get yet another party involved your best bet for variables is to use PCDMIS to read and write to a text file then have your .bas read and write to same and also have your third party read and write to same. That has been a reliable way for me to pass info amongst applications, just be mindfull of how the code is if you ever have to edit, therefore the .bas makes a nice broker.

          Here is code without a variable pass:
          Code:
          CS2        =SCRIPT/FILENAME= C:\PCDMISW\BASICUTIL.BAS
                      FUNCTION/Main,SHOW=YES,,
                      STARTSCRIPT/
          Again these are under Insert > Basic Script. F9 will simply open the .bas with PCDMIS's VB editor so you need to check the help file on variable passing as there is no dialog box or "wizard" to set it up.

          Craig
          <internet bumper sticker goes here>

          Comment


          • #6
            I've attached the bas file I'm working on now to help you out. What I'm looking for is the code inside the bas file if anyone knows how to do it.

            I want to be able to execute my program in PC-DMIS, run a macro I made inside PC-DMIS, and record how long it takes. I've already put in the system start and end times, I just need the macro in between to time how long it takes. I'm doing the test on several different computer systems.
            Attached Files
            "Your mom goes to college."
            Kip

            Comment


            • #7
              The only option I see to save the file is a *.mac file.

              When I open Excell and the VB it doesn't accept *.mac as an accepted file type.
              "Your mom goes to college."
              Kip

              Comment


              • #8
                OK I think I have it. The .bas you posted you want to time (with a macro) on different PCs to see how long it takes to run it. Am I following?

                Craig
                <internet bumper sticker goes here>

                Comment


                • #9
                  No. The bas file was for you hoping it will help you pass variables. It's basically just a menu interface that assigns variables back to pc-dmis depending on what you choose.

                  This is the code I have so far...

                  Code:
                              ASSIGN/V1 = SYSTEMTIME("hh':'mm':'ss: tt")
                              COMMENT/REPT,"Start time: " + V1
                                          , 
                              COMMENT/DOC,********************
                              ASSIGN/V2 = SYSTEMTIME("hh':'mm':'ss: tt")
                              COMMENT/REPT,"End time: " + V2
                                          , 
                              PRINT/REPORT,TO_FILE=ON,AUTO=3,$
                                TO_PRINTER=OFF,DRAFTMODE=OFF,$
                                PREVIOUS_RUNS=DELETE_INSTANCES
                  I want to replace the document comment with the code that will run the script I made inside PC-DMIS.
                  "Your mom goes to college."
                  Kip

                  Comment


                  • #10
                    This might help

                    ASSIGN/X = 0
                    ASSIGN/Y = 0
                    ASSIGN/Z = 0
                    FP =FILE/OPEN,TESTED.TXT,READ
                    DO/
                    V1 =FILE/READLINE,FP,{x}+","+{y}+","+{z}
                    MOVE/POINT,X,Y,Z
                    UNTIL/V1 == "EOF"
                    MOVE/POINT,0,0,0

                    Comment


                    • #11
                      OK bear with me I am getting this. Thanks I knew about assignments through automation I was just hoping that you could pass a variable back to PCDMIS without automation as if it were a calling routine so to speak. I know you can't just a pipe dream. I guess I am lost now. If you have written a .bas you can call it with the code I first posted instead of the comment. Then your plan would work. I guess where I'm lost now is why wont it work? Or does this go back to your question about running *.mac? Sorry if I might be wasting your time with my confision at this point dccfreak has been pretty handy with these issues maybe he can chime in sometime.

                      Craig
                      <internet bumper sticker goes here>

                      Comment


                      • #12
                        You're not wasting my time. I appreciate the help.

                        The problem lies in the macro. In my test I made a macro (*.mac) to rotate the cad, turn the model solid, etc. I'm trying to time how long this takes on different computers in hopes to get an upgrade.

                        I need some way to have the macro run during the execution of a program (Ctrl + Q). I don't know the code to do it in a *.bas file, and I don't think there's anyting in PC-DMIS that will do it without hitting the "Play" button. I may have to do it in front of some bosses so I wanted to make it look good.
                        "Your mom goes to college."
                        Kip

                        Comment


                        • #13
                          What is this supposed to do Tested?

                          Code:
                          ASSIGN/X = 0
                          ASSIGN/Y = 0
                          ASSIGN/Z = 0
                          FP =FILE/OPEN,TESTED.TXT,READ
                          DO/
                          V1 =FILE/READLINE,FP,{x}+","+{y}+","+{z}
                          MOVE/POINT,X,Y,Z
                          UNTIL/V1 == "EOF"
                          MOVE/POINT,0,0,0
                          "Your mom goes to college."
                          Kip

                          Comment


                          • #14
                            OK I'm finnaly following you. Neat idea. I went and looked at the macro function and I didn't see anything that I could help you with. I am seeing it the same way as you it is playable only from the toolbar. At first I thought maybe you could use VBs SendKeys function but there is no shortcut key and then you'd have to get around the FileOpen dialog. I'd hate to say it but I can't think of a way to do it but I'm going to check the Basic language reference. I assume you have it but if you dont here it is.

                            Craig

                            OK update: I just checked the reference and I don't see anything there either. Sorry about that.
                            <internet bumper sticker goes here>

                            Comment


                            • #15
                              My thought was if you could put your macro into a .txt file, you could then bring it in with this type of command. I have brought in touch and move points this way.

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X