Design Assistant - VBA/iLogic to copy Iproperties

Design Assistant - VBA/iLogic to copy Iproperties

Anonymous
Not applicable
899 Views
2 Replies
Message 1 of 3

Design Assistant - VBA/iLogic to copy Iproperties

Anonymous
Not applicable

Hello everyone,

 

Let me preface by saying I am an amateur at code. I have started reading some books to help me out and trying some things on my own.

 

I'll spare you my life story and tell you what I'm looking to do.

 

Where I work, we use 1-5 different .idw pages to detail out our products. We have iProperties set up on each page to fill in the title block. When it is time to upload a drawing to be checked or completed, we typically have to go through the Design assistant and click about 13 different check boxes to copy all of the iProperties over to the other 3-4 drawing pages. 

 

Is there a better way? Can a macro be written that would get the iProperties from "T.idw" and copy it to "N.idw", "S.idw", "A.idw", and "D.idw" either by Design Assistant or just brute force writing to each open document? Would some type of global template be better suited to the task? Any idea/solution would be appreciated.

 

Thanks, maybe one day with enough training I can help solve problems as well.

 

-Gabe

0 Likes
900 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor

1) Why aren't your templates just pulling from the model file that's placed in them?

 

2) Yes. Depending what files and your naming structure of them, it would just be something simple like:

 

Sub Main()
Dim oDocA As Document oDocA = ThisApplication.Document.Open("C:\T.idw") Dim oDocB As Document oDocB= ThisApplication.Document.Open("C:\F.idw") oDocB.PropertySets("Design Tracking Properties")("Stock Number").Value = _ oDocA.PropertySets("Design Tracking Properties")("Stock Number").Value

oDocA.Save
oDocA.Close

oDocB.Save
oDocB.Close
End Sub


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

Anonymous
Not applicable

MechMachineMan,

 

Thanks for your reply. Couple of things, properties of the model are pulled in in some applications. (Material, Description, Filename)

 

The properties that I'm trying to automatically copy are drawing title block specific and don't pertain to parts.

 

ex)

Designed By

Drawn By

Date

Rev

Customer Info

 

The other thing I would like to do is have it copy over to any open .idw regardless of name. Usually my files will be names $T - CAPE SOUTH.idw for example. 

 

I'll try your code today when I have some down time and see what I can make of it. Thanks again! 

 

0 Likes