Inventor Customization

Inventor Customization

Reply
Contributor
00ash00
Posts: 12
Registered: ‎02-21-2012
Message 11 of 19 (344 Views)

Re: Extreme drawing automation

11-22-2012 04:47 AM 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
Active Contributor
Kris_Inv2013
Posts: 39
Registered: ‎07-19-2012
Message 12 of 19 (340 Views)

Re: Extreme drawing automation

11-22-2012 07:19 AM 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...

Contributor
00ash00
Posts: 12
Registered: ‎02-21-2012
Message 13 of 19 (334 Views)

Try this snippet of code   '--Code Start--' Try ModelName...

11-22-2012 12:37 PM 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
Active Contributor
Kris_Inv2013
Posts: 39
Registered: ‎07-19-2012
Message 14 of 19 (311 Views)

Re: Try this snippet of code '--Code Start--' Try ModelName...

11-27-2012 05:55 AM 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!!

Active Contributor
Kris_Inv2013
Posts: 39
Registered: ‎07-19-2012
Message 15 of 19 (296 Views)

Re: Try this snippet of code '--Code Start--' Try ModelName...

11-28-2012 01:39 AM in reply to: Kris_Inv2013

This code does the job perfectly, thanks. :smileyhappy: 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

Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 16 of 19 (290 Views)

Re: Try this snippet of code '--Code Start--' Try ModelName...

11-28-2012 06:18 AM 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!!!

 

Active Contributor
Kris_Inv2013
Posts: 39
Registered: ‎07-19-2012
Message 17 of 19 (280 Views)

Re: Try this snippet of code '--Code Start--' Try ModelName...

11-28-2012 07:14 AM in reply to: mehatfie

Thanks Mitch, this is exactly what I meant.

Contributor
fabiogoncalves
Posts: 25
Registered: ‎11-01-2012
Message 18 of 19 (134 Views)

Re: Extreme drawing automation

11-19-2013 04:44 AM 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.

 

Active Contributor
Kris_Inv2013
Posts: 39
Registered: ‎07-19-2012
Message 19 of 19 (124 Views)

Re: Extreme drawing automation

11-19-2013 05:37 AM in reply to: fabiogoncalves

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

 

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.