Need i-logic function for Export sketch to dwg from part file

Need i-logic function for Export sketch to dwg from part file

Anonymous
Not applicable
432 Views
2 Replies
Message 1 of 3

Need i-logic function for Export sketch to dwg from part file

Anonymous
Not applicable

Hello All,

 

 I have drawn one rectangular sketch in part model. I want to use i-logic rule or form to export that sketch to dwg format.i will use that dwg file in auto cad in future.

 

 

 

Please help me on this.

 

Thank you,

 

Kanagavel.M

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

Anonymous
Not applicable

I modified the code from the following link and made it work with the VBA editor within Inventor.

http://forums.autodesk.com/t5/inventor-customization/export-sketch-as-autocad-dwg-file-question/td-p...

 

Create a sketch and run this macro from the sketch enviroment.

It created a dwg file named sketch.dwg on my desktop.

 

Option Explicit
Sub ExportDWG()

  Dim DWGAddIn As TranslatorAddIn
Dim Doc As Document
       Set DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}")

       Set Doc = ThisApplication.ActiveDocument

       Dim transObjs As TransientObjects

       Set transObjs = ThisApplication.TransientObjects

       Dim context As TranslationContext

       Set context = transObjs.CreateTranslationContext

       context.Type = kFileBrowseIOMechanism

       Dim options As NameValueMap

       Set options = transObjs.CreateNameValueMap

       If DWGAddIn.HasSaveCopyAsOptions(Doc, context, options) Then
          options.Value("Sketch") = True

          options.Value("DwgVersion") = 25
       End If

       Dim oDataMedium As DataMedium

       Set oDataMedium = transObjs.CreateDataMedium

       oDataMedium.FileName = "sketch.dwg"

       Call DWGAddIn.SaveCopyAs(Doc, context, options, oDataMedium)
    
End Sub

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you Jones,

 

It is working fine. I have one more question. If you can, guide me.

 

I want to Use this macro after finishing the sketch. You told to use in sketch environment. Instead, Is it possible way to use this macro from I-logic rules or form like that (automatically triggering from some click on buttons) ?

 

 

Thanks in advance

 

Regards,

 

Kanagavel.M

0 Likes