Drawing View Update for a Part File

Drawing View Update for a Part File

Scott.Hallmark
Advocate Advocate
571 Views
5 Replies
Message 1 of 6

Drawing View Update for a Part File

Scott.Hallmark
Advocate
Advocate

dvu.png

 

I am trying to find code that will do what this button does.  Trying to update a part file view in a DWG, after I run a copy/replace code of a sheet.  I've looked all over and cannot find it here in the forum or anywhere else on the web.

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
572 Views
5 Replies
Replies (5)
Message 2 of 6

JamieVJohnson2
Collaborator
Collaborator

try this:

        Dim drawDoc As Inventor.DrawingDocument = CreateDrawingDoc()
        drawDoc.Update()
        drawDoc.Update2(True)
Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 6

Scott.Hallmark
Advocate
Advocate

I get this:

 

Type 'Inventor.DrawingDocument' is not defined.

** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
0 Likes
Message 4 of 6

JamieVJohnson2
Collaborator
Collaborator

Inventor.Drawing document is defined using the vb.net Autodesk.Inventor.Interop name from file Autodesk.Inventor.Interop.dll

For most ALL Inventor programming environment it should already be loaded (vb.net, vba, and iLogic) should all already understand this namespace.

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 5 of 6

NachoShaw
Advisor
Advisor

Hi

you still need to assign a document to the member

 

VBA

Dim oDoc as DrawingDocument

Set oDoc = ThisApplication.ActiveDocument

 

VB.Net

Private oDoc as Inventor.DrawingDocument = InvDoc 'where InvDoc has been created when the app starts

 

I did write a code to do this properly as we always found that it was better to open the underlying part / assembly and do an update. The code opened the part / assembly invisible, updated it properly, saved it and closed it then updated the drawing.

 

If i find it, i will post it as i made it for another Company a while back

 

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 6 of 6

JamieVJohnson2
Collaborator
Collaborator

Normally I would agree that assigning the member is important.  I expected him to already have that down. 

 

However, the second issue raised here is 'type not defined'.  That's more fundamentally lower level.  If he is using iLogic or vba, that type should already be defined (so I wouldn't know how to solve it).  If he is using a .Net project outside, then he needs to add reference to that dll.

 

Type 'Inventor.DrawingDocument' is not defined.

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes