Use new feature "DrawingReplaceModelReferenceCmd" from Advantage Pack 2010

Use new feature "DrawingReplaceModelReferenceCmd" from Advantage Pack 2010

Anonymous
Not applicable
422 Views
1 Reply
Message 1 of 2

Use new feature "DrawingReplaceModelReferenceCmd" from Advantage Pack 2010

Anonymous
Not applicable
I would like use the new command "DrawingReplaceModelReferenceCmd" in VBA?

How setting reference files and notify the change?

Dim oNewDraw As DrawingDocument
Set oNewDraw = ThisApplication.Documents.Open(Newfile2, False)
' Get the CommandManager object.
Dim oCommandMgr As CommandManager
Set oCommandMgr = ThisApplication.CommandManager

' Get control definition for the line command.
Dim oControlDef As ControlDefinition
Set oControlDef = oCommandMgr.ControlDefinitions.Item( _
"DrawingReplaceModelReferenceCmd")

oNewDraw.(command for Replace Model Reference).item(1) (oldfile, newfile)

' Execute the command synchronously.
Call oControlDef.Execute2(True)

Or if exist otherway for execute the replace?

Tks in advance.
0 Likes
423 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Sorry, the new command doesn't have an API equivalent yet. This is high on
our priorities for a future release.

The API does let you replace file references using
FileDescriptor.ReplaceReference, but this method is currently limited in
that the new document must share ancestry with the original document.

Sanjay-
0 Likes