Autodesk Inventor Customization
- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
iLogic Save As (dwg) if file is idw
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
hello friends
I made a rule to save as dwg.
ThisDoc.Document.SaveAs(ThisDoc.ChangeExtension(".dwg"),True) MessageBox.Show(ThisDoc.FileName(False)& ".dwg Saved!! " & vbCrLf & vbCrLf & ThisDoc.Path , "Save As")
I wonder if it is possible to implement this rule, so it is executed only if you are saving a file in IDW
.
If the file to be saved is a ipt, for example, do not run the save as.
That is, the question is how to know the extension of the newly saved file to test the rule save as?
thank you for your attention
Mechanical Engineer / / Porto Alegre / / Brazil
Inventor Pro 2013
Intel Core i7 12GB RAM
Windows 7 - 64bits
Solved! Go to Solution.
Re: iLogic Save As (dwg) if file is idw
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi mjtubos,
This should work:
'check file type
If ThisDoc.Document.DocumentType <> kDrawingDocumentObject Then
MessageBox.Show("This file is not a drawing file.", "iLogic")
Else
ThisDoc.Document.SaveAs(ThisDoc.ChangeExtension(". dwg"),True)
MessageBox.Show(ThisDoc.FileName(False)& ".dwg Saved!! " & vbCrLf & vbCrLf & ThisDoc.Path , "Save As")
End If I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: iLogic Save As (dwg) if file is idw
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Dear Curtis
Thanks for the prompt solution of my question.
I implemented this code, saving the DWG document in a new directory. I do not know if it would be the best solution, but it worked.
greetings
Marcus Jung
Dim odoc As Document oDoc = ThisApplication.ActiveDocument Dim assemblyPath As String = "E:\Desenhos Marcus\Inventor\_newdir" Dim assemblyFileName As String = System.IO.Path.GetFileName(oDoc.FullFileName) Dim assemblyFileNameNoExt As String = System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName) Dim driverPathAndFileName = assemblyPath + "\" + assemblyFileNameNoExt + ".dwg" If ThisDoc.Document.DocumentType <> kDrawingDocumentObject Then MessageBox.Show("This file is not a drawing file.", "iLogic") Else ThisDoc.Document.SaveAs(driverPathAndFileName , True) MessageBox.Show(ThisDoc.FileName(False)& ".dwg Saved!!! " & vbCrLf & vbCrLf & assemblyPath , "Save As") End If
Mechanical Engineer / / Porto Alegre / / Brazil
Inventor Pro 2013
Intel Core i7 12GB RAM
Windows 7 - 64bits
Re: iLogic Save As (dwg) if file is idw
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
there are two types of .dwg in inventor (at least in INV2009)
Autodesk Inventor drawings
AutoCad drawings
which type will be created by running the code posted?
Re: iLogic Save As (dwg) if file is idw
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
hello
to run the rule above, the file is saved in dwg format Autocad 2007 Drawing.
But that is because I had previously set up by the "Save copy as" the file version for Autocad 2007 Drawing.
Also I wonder if it is possible to do this configuration file version by iLogic code
best regards
Mechanical Engineer / / Porto Alegre / / Brazil
Inventor Pro 2013
Intel Core i7 12GB RAM
Windows 7 - 64bits
