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?
Macro
Collapse
X
-
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/
Here is code without a variable pass:
Code:CS2 =SCRIPT/FILENAME= C:\PCDMISW\BASICUTIL.BAS FUNCTION/Main,SHOW=YES,, STARTSCRIPT/
Craig<internet bumper sticker goes here>
Comment
-
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
-
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
"Your mom goes to college."
Kip
Comment
-
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
-
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
-
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
Related Topics
Collapse
-
Does anyone use Basic script, and if so can you help me. It seems as if i've screwed something up. When i put it in my program and change to (loadexcel)...
-
Channel: DataSuite SPC
04-22-2008, 01:59 PM -
-
by watc98
I experiment with VB script by insert the beep script to a program:
CS1 =SCRIPT/FILENAME= C:\DOCUMENTS AND SETTINGS\MY DOCUMENTS\BEEPTEST.BAS...-
Channel: PC-DMIS for CMMs
03-09-2008, 10:40 AM -
-
by SanderI have this part i would like to put into the end of all our programs.
Is there a more elegant solution to this, like making a single ...-
Channel: PC-DMIS Code Samples
08-10-2017, 08:06 AM -
-
by kaikaiI am new to PC-DMIS script. I am trying to read the script examples in the “Wizards” folder that comes with the installation. However, they are all...
-
Channel: PC-DMIS Code Samples
06-09-2017, 02:44 PM -
-
by IZAKKI was wondering if anyone could help me out with some instructions or information on how to use VB scripts in a program. Things like how to load or input...
-
Channel: PC-DMIS for CMMs
06-09-2008, 12:35 PM -
Comment