Update the active document

Update the active document

Anonymous
Not applicable
1,888 Views
5 Replies
Message 1 of 6

Update the active document

Anonymous
Not applicable
Hi,

I need the VB code to update the active document (equivalente standard tool is shown in attach file) . Can you provide me it?

Thanks you

nekao
0 Likes
1,889 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
oPartDocument.Rebuild or oPartDocument.Rebuild2
0 Likes
Message 3 of 6

Anonymous
Not applicable
Sorry, but I'm not much practice with programming; could you specify the instructions that precede and follow the instruction that you provided in order to provide a complete macro?

Thanks

Nekao
0 Likes
Message 4 of 6

Anonymous
Not applicable
This is a VBA macro that will update the active document (any Inventor document). In VBA (Visual Basic for Applications) "ThisApplication" is an internal variable that gives you a connection to Inventor itself. "ThisApplication" is the root Object which enables you to drill down to obtain any other Object (see attachment). If you write a VB (VB6 or VB.NET) application (i.e. external application), "ThisApplication" won't exist and you'll create your own variable to the Inventor appliction Object (using either GetObject or CreateObject).

{code}
Sub UpdateDocMacro()
Dim oDoc as Inventor.Document
Set oDoc = Application.ActiveDocument
oDoc.Update
End Sub
{code}
0 Likes
Message 5 of 6

Anonymous
Not applicable
Hi Cadfish1,
thanks you for your answer; the code works perfectively. I initially had some problems since in the fourth code line was Application instead ThisApplication.

Bye bye

Nekao
0 Likes
Message 6 of 6

Anonymous
Not applicable
I notice you attahced the 2010 API Object Model. Do you have a like document for the Vault?

I'm looking for the command to attached files to the file in Vault, that are getting create from an Ilogic script.

Joe
0 Likes