VbScript to Open Inventor And Change Project Options

VbScript to Open Inventor And Change Project Options

MechMachineMan
Advisor Advisor
1,695 Views
1 Reply
Message 1 of 2

VbScript to Open Inventor And Change Project Options

MechMachineMan
Advisor
Advisor

Hi there.

 

Looking for some quick help!

 

I want to write a vbscript or some quick executable that achieve the following goals.

 

1) Open a new instance of inventor

2) In this new instance, change the project to a predefined one and activate it.

3) Change where my application options point to content center.

 

 

Why:

a)I have been doing a lot of tweaking to content center in my spare time, and to keep it from affecting our production, I am doing it in a set of working files before I push it to the server files.

Every break, I constantly have to manually perform the steps above which is tedious and annoying.

 

b) I feel like vbscript is quite a powerful tool to have in my repertoire if it can perform this functionality.

 

c) I haven't found a way to be able to run a rule in inventor that switches the active project, esp. seeing as you need all documents close to switch a project.

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Accepted solutions (1)
1,696 Views
1 Reply
Reply (1)
Message 2 of 2

MechMachineMan
Advisor
Advisor
Accepted solution

Well, I did it!

Steps to make it work.

 

1) Open a new notepad file

2) Paste this code

 

Set InvApp = CreateObject("Inventor.Application")
InvApp.Visible = True

InvApp.ContentCenterOptions.SetAccessOption 81153, "C:\Users\Owner\Desktop\CC Library Editting"

Set oProject = InvApp.DesignProjectManager.DesignProjects.ItemByName("C:\Users\Owner\Desktop\CC Library Editting\CC Library Editting.ipj")
oProject.Activate

InvApp.Documents.Open "C:\Users\Owner\Desktop\recessed rubber bumper.ipt", True 

3) Save file as .vbs

4) Run the .vbs

5) Profit!


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type