Change link of a part in assembly with Excel

Experimenter
Experimenter

Hello,

 

I am writing a code in excel to configurate a hydraulic cilinder.

now i am at the point that i have to change the link of a part in assembly.

i have write the following code

 

Sub test()

Dim objAppRev As revisionmanager.Application
Dim objLinkedDocs As revisionmanager.LinkedDocuments
Dim objLinkedDoc As revisionmanager.Document

 

Set objAppRev = CreateObject("RevisionManager.Application")
Set objLinkedDoc = objAppRev.Open("C:\2072 DW 70-40-500\2072 DW 70-40-500.asm")

Set objLinkDocs = objLinkedDoc.LinkedDocuments
objLinkDoc = objLinkedDocs.Item("Plunjerstang.par")

objLinkedDoc.Replace ("C:\test\XX.120400.par")


MsgBox objAppRev.PerformActionInRevisionManager, vbOKOnly

End Sub

 

i haven't any experience with any programming code, but i am able to learn it 

 

 

i hope you guys can help me

1 REPLY

Re: Change link of a part in assembly with Excel

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi,

I think SaveAllLinks method of the opend Document will do the trick.

Look in the Help to get an example.

This line in your code I think is incorrect:

objLinkDoc = objLinkedDocs.Item("Plunjerstang.par")

The variable is "objLinkedDoc"

 

regards

JB
VS2015, SE ST10