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
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
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
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
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?
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
I was reading the code for save Dwg file above
In my case, i need to save it in Inventor dwg version, as if you go to export drawing.
so when i open the drawing in a viewer i see the sheet,, Is that posible with the Ilogic?
Thanks for the help
Hello,
This is in regards with query of Ilogic functionality of Inventor
I have an assembly file say “xyz.iam” and corresponding drawing file by name “xyz.dwg”
Now I am going make dimension changes in assembly file “xyz.iam”, as we know that these changes will propagate to “xyz.dwg” as well.
My query is, whenever I make dimensional changes in “xyz.iam”, illogic have to ask me to rename or change the name of drawing sheet.
I am aware of itrigger option.
Please let me know the sample illogic code to perform the above mentioned operation
Thanking you in anticipation.
Can't find what you're looking for? Ask the community or share your knowledge.