Batch Etransmit not working in 2010

Batch Etransmit not working in 2010

Anonymous
Not applicable
771 Views
1 Reply
Message 1 of 2

Batch Etransmit not working in 2010

Anonymous
Not applicable

Hi,

 

I am having problems with my batch etransmit code below:

 

The routine will open the first drawing, close it then continue on to the next drawing without performing the Etransmit. Once it opens the next drawing the program freezes on the second part of etransmit command:

 

"Enter an option [Create transmittal package/Report only/CUrrent setup/CHoose
setup] <Report only>:"

 

The routine worked fine at the last company I worked at. I have checked the references in the visual basic route and they are set to 2010. (the version i am using now)

 

I even tried a test, running an audit on the drawings to check there wasnt a problem with & vbCr & - that worked fine.

 

 

Private Sub CommandButton1_Click()

Me.Hide

ThisDrawing.SetVariable "Filedia", 0

Open DrList For Input As #1
Do While Not EOF(1)
Line Input #1, TextLine

    zipname = Mid(TextLine, 1, Len(TextLine))
    OpenDoc = ThisDrawing.Application.Documents.Count
    ThisDrawing.Application.Documents.Open (TextLine)


    Set ssetObj = ThisDrawing.SelectionSets.Add("ATK" & Time)
    gpCode(0) = 0
    dataValue(0) = "INSERT"
    gpCode(1) = 2
    dataValue(1) = "*ATK*"
    Mode = acSelectionSetAll
    groupCode = gpCode
    dataCode = dataValue
    ssetObj.Select Mode, , , groupCode, dataCode

    npos = InStrRev(zipname, ".")
    If npos > 0 Then
    zipname = Mid(zipname, 1, npos - 1)
    End If

    ZipFile = zipname
    

    'MsgBox ZipFile
    
     ThisDrawing.SetVariable "Filedia", 0
     ThisDrawing.Application.Documents.Item(OpenDoc).Save
     
    ThisDrawing.Application.ActiveDocument.SendCommand "etransmit" & vbCr & "ch" & vbCr & "Standard" & vbCr & "c" & vbCr & ZipFile & vbCr
    

   '''''''''''TEST
   ''''''''''''ThisDrawing.SendCommand "audit" & vbCr & "y" & vbCr
    
    ThisDrawing.SetVariable "Filedia", 1
       
    ThisDrawing.Application.Documents.Item(OpenDoc).Save
    ThisDrawing.Application.Documents.Item(OpenDoc).Close (False)
    
Loop
Close #1
 ThisDrawing.SetVariable "Filedia", 1
End Sub

 

 

Any ideas would be greatly appreciated.

 

Cheers,

 

 

 

 

0 Likes
772 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
E-Transmit will fail if the drawing has any changes made to it.... (ThisDrawing.Saved is false)

Our company ACADDOC.LSP file does things that will always make the drawing not saved as soon as it's open, so we have to include a QSave before the E-Transmit.
0 Likes