Here is the latest version of the macro that allows Mach3 to open Powerpoint, display your individual slices/slides and move your Z axis into position for each build layer. This solution is only good for slice files that are bitmap files or any format that can be loaded into Powerpoint.
To setup the slides show:
Open PPT and insert a new photo album. Load your slice files. Note: for some reason, when PPT loads a series of images, it puts the last file at the top of the list then continues the order properly. For example. if you have 100 images in your sequence, your order will look like this:
image_100.png
image_001.png
image_002.png
image_004.png
and so on…….
Fig1_A Don’t know why PPT does this but it’s annoying. The first solution would be to select image_100.png and move it down to the end of the list (in the PPT dialog) This could be a pain if you have to move it down, one click at a time, to the bottom of the list.
The easy solution is to go into the folder that contains your slice files, duplicate the last image and rename it image_101.png. Then when you import your slides, you just delete image_101.png, which will be at the top of the list. The rest will be in numerical order.
Fig2_B Under album layout, set picture layout to 1 picture. This will center the images and keep them aligned.
Click create. You will see that the first slide is blank and that’s fine, do not delete this slide. Now just set the background to “black” for all slides. Save as a .pps file not .ppt
Here is the macro for Mach3:
[sourcecode language=”vb”]
Option Explicit
‘Change the constant values below to suit – make sure your Powerpoint file is .pps
‘*****************************************************************
Const ppFileName As String = "C:\My Documents\my slideshow.pps"
Const ZStartPoint As Double = 0.0 ‘where Z starts from
‘*****************************************************************
Dim numSlides As Integer
Dim exposureTime As Integer
Dim ZIncrement As Double
Dim s As Integer
‘ User inputs for variables
NumSlides = 15
exposureTime = 8000 ‘ in ms
ZIncrement = .005
Dim objPPT
Dim objPresentation
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True ‘ set to display on top
Set objPresentation = objPPT.Presentations.Open(ppFileName)
Code "G90" ‘absolute distance mode
Code "G0 Z" & ZStartPoint ‘start Z at wherever
While IsMoving()
sleep 10
Wend
Code "G91" ‘incremental distance mode
SetFeedRate(5/60) ‘ feedrate 5 inches/minute set as appropriate
For s=1 To numSlides
objPresentation.SlideShowWindow.View.GotoSlide (s) ‘show the next slide
sleep exposureTime
objPresentation.SlideShowWindow.View.GotoSlide (1) ‘ show slide 1 blank slide
Code "G1 Z" & ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement ‘lift Z a couple of tads
Code "G4 P1"
While IsMoving()
sleep 10
Wend
Code "G1 Z-" & ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement + ZIncrement ‘lower Z a tad
While IsMoving()
sleep 10
Wend
Sleep 1000 ‘ this value adds a delay before the next slide is displayed
Next
Code "G90" ‘back to absolute distance mode
objPresentation.Close
objPPT.Quit
[/sourcecode]
Copy this text (using the icons that show up when the mouse is over the code) and save as M800.m1s
put it in your Mach3 macros folder (in the profile you are using) then type M800 on the MDI screen. That’s it, You can now adjust the parameters in the macro to suit your machine and resin mixture. Let the experiments begin!
This has been tested successfully with Powerpoint 2003
Thanks to John T for the macro mods! This macro is fully functional but we still want to add more features, I will post updates as they get completed.
Jon
Recent Comments