I am looking for a solution to the following situation:
Any idea where I should begin searching?
Many thanks in advance.
Inventor PDS Premium 2013
Solved! Go to Solution.
Solved! by mehatfie. See the answer in context.
This should do what you would like. It's the same concept as Ash with the File Name but a different opening mechanism.
------------------------------ Code ---------------------
docName = ThisDoc.PathAndFileName(False) & ".idw"
doc = ThisApplication.Documents.Open(docName, True)
Catch ex As Exception
MessageBox.Show("Unable to open Drawing", "Warning")
Let me know if it helps.... Kudos if it works!!!
Everything described is pretty easy, but really depends on your knowledge of programming and as mhatfield asked the complexity of the parts themselves.. There are a few base examples of drawing automation, but as with any custom drawing it's going to require custom programming to do exactly what you need.
That's exactly my problem - I know next to nothing about this type of programming. Or any programming!
But if there is really no better way I guess I will just have to acquire it. In that case where should I begin?
Thanks in advance.
Hi All, Hi Ash,
Please could I also have a copy of your clever code? At the mo I am only intending to open and update the exisitng referenced drawing from my top level asembly. But soon I will have to create new ones and copies and templates. This code would be of great help.
I am also considering to do my whole operation from the drawing environment rather than from the assembly. (spreadsheet and iLogic driven assy(about 150 components), that automaticaly generates a new iteration of the master assy, updates drawings and BOMs, prints .dwf & BOM)
Just out of couriosity, would you guys run the iLogic codes and this automated process from the drawing or from assembly mode considering that the drawing is parent in relation to the assembly?
Any comment would be much appreciated, unfortunately I am alone with this project at our company and hav no chance for a bit of brain storming on best practices.
Can you send me a work flow of what you would like the code to do and i will try to modify it to suit your needs,
The code is in VB.Net and it works as a standalone exe.
With regards to ilogic, I have a large assembly that uses a spreadsheet to drive a complete sprial conveyor, i have found that if you get each part to reference the spreadsheet and each assembly to reference the spreadsheet directly your model will work and update better. this way if you open a part at any time it will get the latest info from the spreadsheet same with the assemblies. if you use ilogic in an assembly to modifiy the parts it can cause a problem during the updating of drawings if you open parts first and print then then open up the assemblies and print them, this will print off the old parts before your assembly has had a change to update them.
Becarefull with your view reps, the Master view rep will show everything, i have 1's and 0's in my spreadsheet to suppress parts that are not required and every now and then a sub-assembly will default back to the master view rep and casue the model to fail, i have added ilogic code in each assembly to set the view rep to a custom one.
Hope this helps
Thanks for your help Ash.
Essentiall what i am trying to achieve now is a code/snippet that opens up the drawing of the assembly I work with. The rule to do this would be in the assembly. I can launch the drawing via iLogic specifying the absolut path to it. But it is not goog enough, I would like to reference it from the active document.
(The right click context menu on the top level assembly (on the model tree in Inventor) has the option of 'Open Drawing'.
Is there a way to do that via iLogic? Unfortunately I can't figure it out if there is. I would like to open and update the relevant drawing.)
Access a broad range of knowledge to help get the most out of your products and services.