Update the active document

Update the active document

Anonymous
不适用
1,913 次查看
5 条回复
1 条消息(共 6 条)

Update the active document

Anonymous
不适用
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 个赞
1,914 次查看
5 条回复
回复 (5)
2 条消息(共 6 条)

Anonymous
不适用
oPartDocument.Rebuild or oPartDocument.Rebuild2
0 个赞
3 条消息(共 6 条)

Anonymous
不适用
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 个赞
4 条消息(共 6 条)

Anonymous
不适用
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 个赞
5 条消息(共 6 条)

Anonymous
不适用
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 个赞
6 条消息(共 6 条)

Anonymous
不适用
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 个赞