Inventor Customization

Reply
Contributor
Posts: 17
Registered: ‎04-24-2012
Message 1 of 17 (549 Views)

macro/code to export all the parameters information (..)

549 Views, 16 Replies
04-26-2012 08:30 PM
Hi
I'm new to the forum, and i hope someone can help me ! :smileyhappy:


I'm currently using Inventor 2012 and i need a macro (code):
I want to know if it's possible to export all the information from the parameters list (everything, names, values, tolerances, comments...) to an excel spreadsheet or a txt file (it can be a table, or a CVS file, i just want that information!), from a part file (.ipt) or a drawing file (.dwg).

Currently, i can only export the parameters' names and values , but i can't get to the tolerance values and comments . . . 

Is there anyway to do this ?

Many thanks,
Regards

JVC
Employee
Posts: 403
Registered: ‎01-06-2009
Message 2 of 17 (517 Views)

Re: macro/code to export all the parameters information (..)

05-16-2012 08:35 PM in reply to: joao.av.c

Hello JVC,

 

I attach an IVB file that you can use to export parameter properties to excel, you can modify it to export any other properties you want.

 

Hope it helps.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Contributor
Posts: 17
Registered: ‎04-24-2012
Message 3 of 17 (508 Views)

Re: macro/code to export all the parameters information (..)

05-18-2012 01:18 AM in reply to: yuhanzhang

Hello yuhanzhang

 

Thank you for your reply, but when i try to run the macro, an error message shows up:

" Compile Error: can't find project or libray."  :\

 

How do i solve this ?


Regards,

JVC 

Employee
Posts: 403
Registered: ‎01-06-2009
Message 4 of 17 (495 Views)

Re: macro/code to export all the parameters information (..)

05-20-2012 06:41 PM in reply to: joao.av.c

Can you tell which line the error occurs? And have you Excel 2010 installed on your machine, or a different version? If you have a different Excel version installed, then please change the reference to that Object Library:

 

1. Load the IVB into VBA Editor.

2. Click Tools->References.

3. In the References dialog find the "Microsoft Excel *.0 Object Library", the '*' indicates the version number that you have.

 

Please let me if this solves.

 



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Contributor
Posts: 17
Registered: ‎04-24-2012
Message 5 of 17 (492 Views)

Re: macro/code to export all the parameters information (..)

05-20-2012 07:20 PM in reply to: yuhanzhang

The error occurs in line 10 ("Dim oExcel As Excel.Application"), but line 1 turns yellow ("Sub ExpoertParamToText()")

I currently have M.Office Excel 2007, and on Tools > References , I have a "MISSING: Microsoft Excel 14.0 Object Library" checked... Is it supposed to be that way ?

 

 

Thank you for your help so far!

JVC

 

 

 

Employee
Posts: 403
Registered: ‎01-06-2009
Message 6 of 17 (469 Views)

Re: macro/code to export all the parameters information (..)

05-23-2012 11:13 PM in reply to: joao.av.c

Sorry for late response. I added the reference to Excel 2010(Microsoft Excel 14.0 Object Library) in the IVB file, if you have the Excel 2007 then you have to modify the reference to your version.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Contributor
Posts: 17
Registered: ‎04-24-2012
Message 7 of 17 (458 Views)

Re: macro/code to export all the parameters information (..)

05-24-2012 08:36 AM in reply to: yuhanzhang

Hello Zhang,

 

Thank you so much for your help, i was able to do it ! :smileyhappy:

 

 

I just needed one more thing: is it possible to  export the tolerance information? For example:

 

- if i have a hole in a part, and i set the deviation tolerance, with maximum and minimum values, can i export these ?

 

- or if i set a H7 tolerance for a hole (or a shaft), can i export these too ?

 

 

Once again, thank you!
Regards,

JVC 

Employee
Posts: 403
Registered: ‎01-06-2009
Message 8 of 17 (453 Views)

Re: macro/code to export all the parameters information (..)

05-24-2012 07:31 PM in reply to: joao.av.c

Yes, sure you can. You can get the Upper, Lower, HoleTolerance and ShaftTolerance from Parameter.Tolerance object. You can firstly check what tolerance type the parameter is set, and then export the tolerance values you want.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

Contributor
Posts: 17
Registered: ‎04-24-2012
Message 9 of 17 (451 Views)

Re: macro/code to export all the parameters information (..)

05-24-2012 08:31 PM in reply to: yuhanzhang

In order to do that, do i have to change/edit the code?

 

Wich lines do i have to edit (or add) and in wich section of the code ?

Can you help me do that ?

 

 

Thank you so much, you really helped me and my project ! :smileyvery-happy:


Regards,

JVC 

Employee
Posts: 403
Registered: ‎01-06-2009
Message 10 of 17 (444 Views)

Re: macro/code to export all the parameters information (..)

05-25-2012 02:40 AM in reply to: joao.av.c

Try attached IVB.



Rocky Zhang
Inventor API
Manufacturing Solutions
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube