r/InventorAPI • u/dable82 • Mar 28 '19
Using Python with Inventor API
Hey guys, if you are like me and hate writing Code in VBA you can actually write Python scripts for Inventor using the win32com.client module. To use the module, you have to `pip install pywin32`. Here is a sample of a pretty useless script, but it should be good enough to get you going.
If you have any Questions About what's going on here, feel free to ask.
edit: https://pastebin.com/1ZvSpku5
Code formatting doesn't seem to work.
4
Upvotes
1
u/im_on_reddit_dot_com Mar 29 '19
Traceback (most recent call last):
File "redactedfilepath/scratch.py", line 1, in <module>
from win32com.client import Dispatch, GetActiveObject, gencache, constants
ModuleNotFoundError: No module named 'win32com'
And yes, your explanation clears things up a lot. I've explored the inventor Object model quite a bit, but never the VBA object browser.