automatically generate idw sheet by API

automatically generate idw sheet by API

Anonymous
Not applicable
513 Views
2 Replies
Message 1 of 3

automatically generate idw sheet by API

Anonymous
Not applicable

Hi

 

I have question about how can i generate a idw sheet from active opened not saved part and by one click it should save the part and the sheet as idw with the same name?. It should be in VB

 

 

 

thanks

0 Likes
514 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator

I have a huge batch draw system that performs those tasks.  Here are a few highlights from your requests:

Dim drawDoc As Inventor.DrawingDocument = CreateDrawingDoc()

Public Function CreateDrawingDoc() As Inventor.DrawingDocument
        Dim drawDoc As Inventor.DrawingDocument = Nothing
        Try
            Dim invSilent As Boolean = invApp.SilentOperation
            invApp.SilentOperation = True
            drawDoc = invApp.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, BatchDrawings.Instance.DrawingTemplate)
            Dim strFileName As String = Me.NewDrawingPath
            Try
                drawDoc.SaveAs(strFileName, False)
            Catch
                MsgBox("Can not save file with this name it is probably already open as a different document." & vbCrLf & strFileName)
                Me.Errors += "[Can not save file]"
            End Try
            invApp.SilentOperation = invSilent
        Catch ex As Exception
            Dim eh As New ErrorHandler(ex)
            eh.HandleIt()
        End Try
        Return drawDoc
    End Function

Just pick the name for both files and save them.

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 3 of 3

Anonymous
Not applicable
Thanks a lot JamieVJohnson2 i'll try it and give my feedback 
0 Likes