Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Using %USERNAME% variable in Application Options

Anonymous

Using %USERNAME% variable in Application Options

Anonymous
Not applicable
We are using Autodesk Inventor 2017 in a lab environment. We would like to create an exported template that all the students can use to set their Application Options. The option that we are having problems with is the "Projects folder" option. We are trying to Export the settings with the "Projects folder" set to: "\\kkids\msStudents\%USERNAME%\Projects. Is there a way to achieve what we are trying to do?
0 Likes
Reply
928 Views
3 Replies
Replies (3)

MechMachineMan
Advisor
Advisor

Write a script to set the application option locations that utilizes the environment shortcut.

 

ie;

 

ThisApplication.ApplicationOptions = Environ$(%UserName%) & "\Sub-Folder"

**Code above is sample only, and you should not expect it to work. It is only to communicate the concept**


--------------------------------------
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

Anonymous
Not applicable
Where and how would the script be run?
0 Likes

MechMachineMan
Advisor
Advisor

Many different ways.

 

You could store it in a part file;

You could use it as an external rule;

You could execute a .vbs file that connects to the program

You could use excel vba.


--------------------------------------
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