VBA API Sketch entities from Excel into Inventor

VBA API Sketch entities from Excel into Inventor

ZahnradKopf
Enthusiast Enthusiast
2,094 Views
9 Replies
Message 1 of 10

VBA API Sketch entities from Excel into Inventor

ZahnradKopf
Enthusiast
Enthusiast

Looking for direction and examples for exporting points FROM Excel, INTO Inventor.

 

I have an Excel workbook that performs hundreds of calculations and outputs many pieces of data that I can then use for constructing sketches and their entities. I already have written/murderfied some that work well with doing this in SolidWorks. Something similar to the "import points from excel" function. However, I want to initiate the transaction from the excel side, via VBA macro. I would like to be able to do this in Inventor, now. (So, I will also need to know what references to enable from within the excel side VBA.)

 

Any direction would be appreciated. Thank you.

American Machine & Gear Works
Milwaukee, Wisconsin

http://TheGearMaker.com
http://Instagram.com/AmericanMachineAndGear
0 Likes
2,095 Views
9 Replies
Replies (9)
Message 2 of 10

johnsonshiue
Community Manager
Community Manager

Hi! You can automate it using iLogic or VBA but you can also do it manually.

 

Check out reply #4 and #5 in https://forums.autodesk.com/t5/inventor-customization/importing-points-from-excel-to-inventor/td-p/7...

 

Manual workflow video:

https://www.youtube.com/watch?v=aEWh0pJPxMI

 

Help document:

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2014...

 

Many thanks!



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes
Message 3 of 10

ZahnradKopf
Enthusiast
Enthusiast

Johnson,

 

Thank you for your response. If I am understanding this correctly, the thread you link to is not what I am seeking. Rather, it is opposite of what I seek to do.

 

I want to use an Excel VBA macro to insert points into a Sketch, from Excel. ( EXPORT from Excel, inserting INTO Inventor ) Part of this reason is that the originating Workbook ( and thus, Worksheet ) are never the same. So, they cannot be linked to. There is one Worksheet in my Workbook that is populated ( via macros ) with the points I want to use. I have another macro that then is used to create a Sketch in SolidWorks and insert these points into that Sketch, ready for my further use.

 

I want to create another macro so that I have the ability to send it to Inventor, as an alternative. ( in effort to move away from SolidWorks )

 

Clear as mud? Thank you for your assistance.

American Machine & Gear Works
Milwaukee, Wisconsin

http://TheGearMaker.com
http://Instagram.com/AmericanMachineAndGear
0 Likes
Message 4 of 10

johnsonshiue
Community Manager
Community Manager

Hi! I thought I understood it correctly. You have point coordinates in Excel and you want to create sketch points in Inventor based on those points, right? Manually, you simply start a part, create a 2D/3D sketch, and then use Import Poionts command to bring the points from the Excel spreadsheet (X, Y, and Z coordinates). You can also select if a spline or lines are created.

For automated workflow, one of the links above should contain the information. Or, you just google it. There should be plenty of discussions about this.

Many thanks!



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes
Message 5 of 10

ZahnradKopf
Enthusiast
Enthusiast

Johnson,

 


@johnsonshiue wrote:

Hi! I thought I understood it correctly. You have point coordinates in Excel and you want to create sketch points in Inventor based on those points, right?


Yes.


@johnsonshiue wrote:

Manually, you simply start a part, create a 2D/3D sketch, and then use Import Poionts command to bring the points from the Excel spreadsheet (X, Y, and Z coordinates).


This is where I am likely not being clear enough. That is specifically what I do not want to do. I want it to be initiated from the Excel macro. I am looking for either examples or a listing of the macro commands that will run in Excel's VBA macro.


@johnsonshiue wrote:

For automated workflow, one of the links above should contain the information. Or, you just google it. There should be plenty of discussions about this.

Many thanks!


I've googled until I am bleary eyed. I'm not finding anything. That's why I posted. I will read the links again, but I am not seeing what I am looking for. Maybe I have overlooked it?

 

Thank you.

 

 

 

American Machine & Gear Works
Milwaukee, Wisconsin

http://TheGearMaker.com
http://Instagram.com/AmericanMachineAndGear
0 Likes
Message 6 of 10

ZahnradKopf
Enthusiast
Enthusiast

This is what it looks like now. (this is a small snippet of a much larger view )

 

I do not need to do anything from inside SolidWorks to use it and that is what I seek to accomplish with Inventor, as well. Thank you.

 

Excel-SolidWorks-Export-Macro

American Machine & Gear Works
Milwaukee, Wisconsin

http://TheGearMaker.com
http://Instagram.com/AmericanMachineAndGear
0 Likes
Message 7 of 10

johnsonshiue
Community Manager
Community Manager

Hi! I think you want to "push" those points in Excel to Inventor 2D/3D Sketch. It should be doable but I don't have the VB.Net code to do that. Let me ping @Curtis_Waguespack.

Hi Curtis,

 

Do you know if this is doable?

Many thanks!



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes
Message 8 of 10

ZahnradKopf
Enthusiast
Enthusiast

@johnsonshiue  @Curtis_Waguespack

 

Even if you could direct me to where there is a list of the available API VB commands, it would be helpful. At the very least, it would allow me to read and scan through for what I am trying to do. Hopefully, I am not the first person to have wanted to do this, though. ( That would be difficult to believe. )

 

Thanks for your assistance. 

American Machine & Gear Works
Milwaukee, Wisconsin

http://TheGearMaker.com
http://Instagram.com/AmericanMachineAndGear
0 Likes
Message 9 of 10

Curtis_Waguespack
Consultant
Consultant

@ZahnradKopf 

 

I'm thinking that you would access the Inventor Apprentice Server via through Excel to do what you are after, but I've not done this specifically so I could be mistaken... in any case more information on Apprentice can be found here:

http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-F2A12822-98DE-4638-B1C7-6BEEF821D50A

 

Inventor's API User Manual can be found here:

http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-5901102A-F148-4CD4-AF50-26E2AFDEE6A7

 

And there is an overview here:

http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-4939ABD1-A15E-473E-9376-D8208EC029EB

 

Also just as a note, programming questions of this type are better asked on the Inventor Customization forum, so I've asked the moderators to move this topic to that forum....  so hopefully someone on that forum might be able to give you more specific information on your questions:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

0 Likes
Message 10 of 10

ZahnradKopf
Enthusiast
Enthusiast

@Curtis_Waguespack 

 

Thank you. I am hoping that someone here knows this topic ( at least mildly ) because I am obviously not smart enough to grok it on my own so far. After reading some of what you linked, I am as confused as ever.

 

Basically, I have the data that I want "pushed", ready to go, and set in a VBA "range". To start, I just need to be able to pass those to the creation of points within a sketch. ( currently two columns of points that correlate to X/Y coordinates. )

 

Any assistance is appreciated. Thank you.

American Machine & Gear Works
Milwaukee, Wisconsin

http://TheGearMaker.com
http://Instagram.com/AmericanMachineAndGear
0 Likes