I am trying to open some dxf files through a script I wrote and the first dialog box that pops up is the scale select box. I tried setting the option in my script but is keeps having an error when it get to the scale I set.
Private appillustrator As New Illustrator.Application
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Select the URD drawings folder you want to run the program on.
Dim result As DialogResult
MsgBox("Please select the folder containing the drawings you want to convert to the .dxf format.")
result = FolderBrowserDialog1.ShowDialog
Dim ext As String
ext = ".ai"
'Check for files with the 'URD' extension.
For Each file As String In System.IO.Directory.GetFiles(FolderBrowserDialog1.SelectedPath)
'System.IO.Directory.CreateDirectory()
Dim slashposition As Integer = file.LastIndexOf("\")
Dim filenameOnly As String = file.Substring(slashposition + 1)
If IO.Path.GetExtension(file).ToLower = ".dxf" Then
Try
'appillustrator.Visible = True
Catch
appillustrator = New Illustrator.Application
End Try
appillustrator.Open(file, False, Illustrator.AiAutoCADGlobalScaleOption.aiFitArtboard)
appillustrator.ActiveDocument.SaveAs(file & ext)
Else
'Skip this drawing as its not a 'DXF' and go to the next drawing.
End If
Next
'Exit Illustrator.
appillustrator.Quit()
MsgBox("Your drawings in" & FolderBrowserDialog1.SelectedPath & " have been completed." & vbCrLf & vbCrLf & _
"Please review the converted files for errors")
End Sub