Hi
Today, It's possible to do bach IDW to DWG conversion, but autodesk doesn't provide a tool to do the opposite:
Inventor's DWG to IDW
Somebody have an idea or a script to do that ?
Regards,
Aurélien
Hi,
It looks you can save as the Inventor DWG to idw directly. So you could just check if the document is Invenrtor DWG by
DrawingDocument.IsInventorDWG, and call SaveAs. Is this fine to you?
Hi,
I would like to know the same.
I have hundreds of .dwg drawings created out of Inventor and I would like to convert those drawings to .idw.
Is there any macro available for the same?
Please let me know.
Hi, would you like to convert all drawings from a folder or from an assy?
This code will convert all DWG files from specifed folder. All you have to do is change the folder, run it and give it some time to do the work.
Dim oPath As String = "C:\Path\MorePath\DesiredFolder\" Dim File As String Dim Files As String() Files = System.IO.Directory.GetFiles(oPath, "*.dwg") For Each File In Files Dim oDoc As DrawingDocument = ThisApplication.Documents.Open(File, False) If oDoc.IsInventorDWG Then oDoc.Update oDoc.SaveAs(Left(File, Len(File) - 3) & "idw", True) End If oDoc.Close(True) Next
BTW.: It's not a good thing to resurrect a 3 years old thread.
Hi Mike,
Thanks for your quick support.
I will run the code and let you know the status
Hi, do the DWGs have the same filenames and paths as the IPTs / IAMs ?
Hi Mike,
Yes, DWGs have the same filenames and paths as the IPTs / IAMs.
Hi, this should do the trick:
Sub Main() Dim oDoc As Document = ThisApplication.ActiveDocument If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then Dim aDoc As Document For Each aDoc In oDoc.AllReferencedDocuments ReSaveDWG(aDoc.FullFileName) Next End If ReSaveDWG(ThisDoc.Path & "\" & ThisDoc.FileName(True)) End Sub Sub ReSaveDWG(File As String) File = Left(File, Len(File) - 3) & "dwg"
Try Dim oDoc As DrawingDocument = ThisApplication.Documents.Open(File, False) If oDoc.IsInventorDWG Then oDoc.Update oDoc.SaveAs(Left(File, Len(File) - 3) & "idw", True) End If oDoc.Close(True)
Catch
' Catching documents without drawing
End Try End Sub
Hi Mike,
I was going through script do we need to paste it in specific folder in which files need to be converted or i can just paste a link for it.
Thanks