Hi all,
Greetings!
I am looking for a solution to the following situation:
I need:
Any idea where I should begin searching?
Many thanks in advance.
Cheers
H.S.
Inventor PDS Premium 2013
Solved! Go to Solution.
Solved by mehatfie. Go to Solution.
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.
Hi Jon,
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.
Cheers
H.S.
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.
Regards,
Kris
Hi Kris,
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
Ash
Hi Ash,
Yes very much interested in the codes. Please help.
Thanx!
Cheers
H.S.
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.)
Thanks,
Kris
Thats right, thats what I am trying to get to. Unfortunately I can't find a command to actually open up a document. I am confortable to save it, create new ones, whether it is a pdf, dwf 2D/3D, etc. but I can't find the 'Open document' function in iLogic. Is there such code snippet in there?
I have tried ThisDocument.Open but it returns an error message saying that it is not an iLogic operation...
Try this snippet of code
'--Code Start--'
Try
ModelName=ThisDoc.PathAndFileName(False)
DrawName= ModelName & ".idw"
ThisDoc.Launch(DrawName)
Catch
MessageBox.Show("Unable to open Drawing", "Warning")
End Try
'--Code Finished--'
Regards
Ash
Hi Ash, sorry for delaying with response, I am very busy with other stuff at he mo. I will try this one, many thanks!!
This code does the job perfectly, thanks. 🙂 It opens up the relevant drawing in a new window.
Now, if I'd like to open it up in a new tab (assumung that the model is open alredy) rather than in a new window launching Inventor again, is it an Inventor setting or should be programmed?
Thanks,
Kris
Hi Kris,
This should do what you would like. It's the same concept as Ash with the File Name but a different opening mechanism.
------------------------------ Code ---------------------
Try
docName = ThisDoc.PathAndFileName(False) & ".idw"
doc = ThisApplication.Documents.Open(docName, True)
Catch ex As Exception
MessageBox.Show("Unable to open Drawing", "Warning")
End Try
---------------------------------------------------------------------------------
Regards
Mitch
Let me know if it helps.... Kudos if it works!!!
Hi! I was searching exactly for some code to do this! is it a simple code? can you show me what kind of code youre using?
it would be helpful for me in order to costumize to my needs. Thanks a lot for your help!! it would be great if you could give me some help on this.
Hi Fabio,
I am not sure what you are after exactly but in order to launch the drawing I used the code from Ash and Mitch exactly as they shared it.
Regards,
Kris