Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

export .idw to Autocad & Inventor .dwg

1 REPLY 1
Reply
Message 1 of 2
andrew_canfield
262 Views, 1 Reply

export .idw to Autocad & Inventor .dwg

Hello

 

I've been using this to export an idw to an Autocad .dwg but don't know how to set an 'Inventor.dwg' option.

The full ilogic program opens, exports, closes then moves to the next file, exporting 'ThisDocument' doesn't work because 'ThisDocument' holds the ilogic code - it's to export the file which has been opened & I can't find a TranslatorAddIn for an .idw (not sure if there is one, why would there be a need to translate an idw) - is it possible to mimic line 2 to Dim DWGAddIn as the open idw?

    '''--- Publish document.
    Dim DWGAddIn As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}")
    DWGAddIn.SaveCopyAs(oDoc, oContext, oOptions, oDataMediumDWG)
	'MessageBox.Show(newFullFileName, "newFullFileName")

Regards

 

Andrew

 

1 REPLY 1
Message 2 of 2

Hi @andrew_canfield . Please try this export method in InventorDWG:

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim sPath As String = System.IO.Path.GetDirectoryName(oDoc.FullFileName)
Dim sName As String = System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName)
If Not System.IO.File.Exists(sPath & "\" & sName & ".dwg") Then
	oDoc.SaveAsInventorDWG(sPath & "\" & sName & ".dwg", True)
End if

 

True = Save off a copy as a DWG, and keeps the current file open.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

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

Post to forums  

Autodesk Design & Make Report