0% found this document useful (0 votes)
191 views2 pages

Macro Lasergrbl

This subroutine exports either the selected items or the entire document from Adobe Illustrator to a file called "export.ai" located in the user's home directory. It then opens that newly exported file using the LightBurn software to prepare it for laser cutting.

Uploaded by

organik making
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views2 pages

Macro Lasergrbl

This subroutine exports either the selected items or the entire document from Adobe Illustrator to a file called "export.ai" located in the user's home directory. It then opens that newly exported file using the LightBurn software to prepare it for laser cutting.

Uploaded by

organik making
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sub Lightburn()

Dim answer As Integer


Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
OrigSelection.CreateSelection
Dim expopt As StructExportOptions
Set expopt = CreateStructExportOptions
expopt.UseColorProfile = True
Dim expflt As ExportFilter

Dim out_file As String


out_file = "C:" & Environ("HOMEPATH") & "\export.ai"
If Len(Dir$(out_file)) > 0 Then
Kill (out_file)
End If

' is an item selected?


If ActiveSelectionRange.Count > 0 Then
' something is selected export it
Set expflt = ActiveDocument.ExportEx(out_file, cdrAI, cdrSelection, expopt)
With expflt
.Version = 10 ' FilterAILib.aiVersionCS6
.TextAsCurves = True
.PreserveTransparency = True
.ConvertSpotColors = True
.SimulateOutlines = False
.SimulateFills = False
.IncludePlacedImages = True
.IncludePreview = True
.EmbedColorProfile = True
.Finish
End With

Else
answer = MsgBox("Nothing was selected, Export All?", vbYesNo + vbQuestion,
"Export All")
If answer = vbYes Then
' Export everything
Set expflt = ActiveDocument.ExportEx(out_file, cdrAI, cdrAllPages,
expopt)
With expflt
.Version = 10 ' FilterAILib.aiVersionCS6
.TextAsCurves = True
.PreserveTransparency = True
.ConvertSpotColors = False
.SimulateOutlines = False
.SimulateFills = False
.IncludePlacedImages = True
.IncludePreview = True
.EmbedColorProfile = True
.Finish
End With

Else
'do nothing
Exit Sub
End If
End If
' Edit this like if lightburn is in a diffrent location
Call Shell("C:\Program Files\LightBurn\LightBurn.exe " & out_file,
vbNormalFocus)
End Sub

You might also like