VBA: Change "Creation Date" iProperty

VBA: Change "Creation Date" iProperty

Anonymous
Not applicable
5,202 Views
7 Replies
Message 1 of 8

VBA: Change "Creation Date" iProperty

Anonymous
Not applicable

Hi everyone,

 

I am trying to write a program that creates new drawings using predimensioned templates.

 

One of the issues with this is that the Creation Date iProperty does not change from the original template when a new drawing is created.

I was wondering how I can go about using VBA to call the Creation Date iProperty and change it to the current date.


Thanks!

0 Likes
Accepted solutions (1)
5,203 Views
7 Replies
Replies (7)
Message 2 of 8

MechMachineMan
Advisor
Advisor
Accepted solution

Dim oDoc As Document = ???

 

'oDoc.PropertySets.Item("Design Tracking Properties").Item("Creation Time").Value = "01.Jun.12"

 

or

 

'oDoc.PropertySets.Item("Design Tracking Properties").Item("Creation Time").Value = DateTime.Now.ToString("d")


--------------------------------------
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
Message 3 of 8

Anonymous
Not applicable

Awesome, this works great!!

 

Just wondering, where can I possibly find the object model for the Inventor iProperties? i.e. How did you know that Creation Time fell under Design Tracking Properties?

 

If you can tell me this real quick Ill mark your above answer as right.

0 Likes
Message 4 of 8

MechMachineMan
Advisor
Advisor
iProperties: http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html

Everything else I usually just have a bit of a search through the Programming Help within inventor using keywords. If I can find that, I will peruse the levels higher up from it; Ie; Balloons will be searched for first, if nothing, then I will go see if anything is visible in Sheet.

There is also the Event Watcher that is available for helping to discover objects, although I haven't really used it.


--------------------------------------
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
Message 5 of 8

BrandonBG
Collaborator
Collaborator

http://modthemachine.typepad.com/files/iProperyNameTable.pdf

 

The names can differ from what you see in the iProperties tabs, but I use this chart all the time.

 

Brandon

0 Likes
Message 6 of 8

Anonymous
Not applicable

Good afternoon,

 

I am attempting to input this code into my 2018 inventor. I have a title block with <CREATIONDATE> but need the current date...where do I input the code? I am a rookie VBA programmer.

0 Likes
Message 7 of 8

dba78
Advocate
Advocate

one year later 🙂

 

Do you want to show the creation date of the drawing? Link the textfield of your TitleBlock to the drawing's iProp. No coding needed in this manner. The value will be set, as you save the drawing for the first time.

 

image.png

 

Or in case of Creationdate of the modell (those Props will be read from the FIRST VIEW MODEL in your sheet):

 

image.png

Is this what you're looking for?

If not, please extend your request 🙂

0 Likes
Message 8 of 8

raja
Explorer
Explorer
Dim oDoc As Document = ThisDoc.Document
oDoc.PropertySets.Item("Design Tracking Properties").Item("Creation Time").Value = DateTime.Now.ToString("d")
0 Likes