VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Etransmit not working in 2010

1 REPLY 1
Reply
Message 1 of 2
CJSinfield
679 Views, 1 Reply

Batch Etransmit not working in 2010

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,

 

 

 

 

1 REPLY 1
Message 2 of 2
Steeve_Vajk
in reply to: CJSinfield

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.
================================
Vanilla AutoCAD 2012/14/15/16

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost