Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Extreme drawing automation

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
hungsianglim
2367 Views, 18 Replies

Extreme drawing automation

Hi all,

 

Greetings!

 

I am looking for a solution to the following situation:

 

  • One part
  • Two different part numbers
  • Three drawings for one part, in three different sheet formats, 1st and 3rd having the same drawing number (=part number)
  • Up to seven different materials

I need:

 

  • To automatically generate the three drawings (in idw or even PDF) after part creation and the content of the drawing is fully dimensioned and annotated for all available types of materials.

Any idea where I should begin searching?

 

Many thanks in advance.

 

Cheers

 

H.S.

Inventor PDS Premium 2013

18 REPLIES 18
Message 2 of 19
mehatfie
in reply to: hungsianglim

Hi hungsianglim,

 

How complex are these parts?

 

Regards

Mitch

Message 3 of 19
jdkriek
in reply to: mehatfie

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.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 4 of 19
hungsianglim
in reply to: hungsianglim

Hi Mitch, Thanks for you reply. The parts are not overly complex. The headache for me is one of management & control and productivity. Elaboration: 1. Management & control We are currently producing all 3 sheets in one idw file. The actual steps are first create a drawing content on sheet #1, upon completion copy and paste the same into sheet #2 and #3. After that some information is removed from sheet #3 and the file is saved. At this point the job is considered complete. All data in the title block draw information from iProperties. 2. Productivity If the above already-cumbersome tasks were multiplied 10,000 times it is not difficult to imagine the kind of life I am now living! The entire process is slow and painful, and not very motivating (as an engineer). Thanks for commenting. Cheers H.S.
Message 5 of 19
hungsianglim
in reply to: jdkriek

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.

Message 6 of 19
00ash00
in reply to: hungsianglim

Can you use the sketch dimensions in you drawing views, if so I have some code that we use, form an assembly file it opens up every referenced file, if that file has a part number, it looks to see if there is a drawing in the same folder as the referenced file (iam or ipt) if not, opens a template adds 4 views, scales the views to fit on A1 page, retreves the sketch dimensions, adds automated center lines, adds parts list. If ipt file is a sheetmetal part it will put a flat pattern on sheet 2 and adds a hole table to the top left hand corner. If a laser cut profile is required. The profile is placed onto sheet three and the border and title block is deleted and a laser note is added to the sheet then it is exported to dwg. The programme will also print to default printer and to pdf. Email me if this could be of any help.

Ash
IV 2013
AutoDrafter 2013
ash0968@gmail.com.au
Ash

Dell - T1650
Intel(R)Xeon(R) CPU E3-1290 V2 @ 3.70GHz
16GB
64-Bit
Windows 7 Pro
Inventor 2013 Build: 138
Message 7 of 19
Kris_Inv2013
in reply to: 00ash00

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

 

Message 8 of 19
00ash00
in reply to: Kris_Inv2013

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

Ash

Dell - T1650
Intel(R)Xeon(R) CPU E3-1290 V2 @ 3.70GHz
16GB
64-Bit
Windows 7 Pro
Inventor 2013 Build: 138
Message 9 of 19
hungsianglim
in reply to: hungsianglim

Hi Ash,

 

Yes very much interested in the codes.  Please help.

 

Thanx!

 

Cheers

 

H.S.

Message 10 of 19
Kris_Inv2013
in reply to: 00ash00

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

Message 11 of 19
00ash00
in reply to: hungsianglim

I read in one of the posts back some time ago that if you right click in the model tree and select "Open Drawing" all it does is take the file name and changes the file extenion to idw and serches through the project folders until it finds the file, if it cannot find the file it opens the "Open Dialog Box". With your ilogic code get it find the FullFileName of the of the assemble and change iam to idw and open it that way.

Ash
Ash

Dell - T1650
Intel(R)Xeon(R) CPU E3-1290 V2 @ 3.70GHz
16GB
64-Bit
Windows 7 Pro
Inventor 2013 Build: 138
Message 12 of 19
Kris_Inv2013
in reply to: 00ash00

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...

Message 13 of 19
00ash00
in reply to: Kris_Inv2013

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

Ash

Dell - T1650
Intel(R)Xeon(R) CPU E3-1290 V2 @ 3.70GHz
16GB
64-Bit
Windows 7 Pro
Inventor 2013 Build: 138
Message 14 of 19
Kris_Inv2013
in reply to: 00ash00

Hi Ash, sorry for delaying with response, I am very busy with other stuff at he mo. I will try this one, many thanks!!

Message 15 of 19
Kris_Inv2013
in reply to: Kris_Inv2013

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

Message 16 of 19
mehatfie
in reply to: Kris_Inv2013

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!!!

 

Message 17 of 19
Kris_Inv2013
in reply to: mehatfie

Thanks Mitch, this is exactly what I meant.

Message 18 of 19
F.Goncalves
in reply to: 00ash00

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.

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
--
F.Goncalves
Message 19 of 19
Kris_Inv2013
in reply to: F.Goncalves

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

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report