OPEN FILE IN REVISION MANAGER

 

Hi,

I'm trying to open a .DFT file in REVISION MANAGER in order to copy it and then the linked documents. I've seen several examples in C but I use VB6.I've tried the code present in the topic: Subject: C# RevisionManager.Document problem

Private Sub CommandButton2_Click()

Dim rm               As Object

Dim doc              As Object

Dim links            As Object

Dim n                As Integer

Set rm = GetObject("", "RevisionManager.Application")

rm.Visible = True

Set doc = rm.Open("c:\asm2.asm")

Set links = doc.LinkedDocuments

n = links.Count

 

End Sub

Unfortunately, the file doesn't open. Well, the code opens something so if I close REVISION MANAGER in step-by-step, it demands me if I want to save the changes. In another topic I've seen that adding -r (or /r) we are able to open REVISION MANAGER, but in the console...

What must I do to open the desired file in REVISION MANAGER?

Many thanks and congratulations for the web. It's really fantastic!

ALFONS

 

 

Posted by: alfons morral
Post date: 8/31/2008 6:00:40 AM

2 REPLIES

RE: OPEN FILE IN REVISION MANAGER

Hi Alfons,

 

RevisionManager automation is always invisible. If you want to copy a draft and the linked docs per API then your code is the right start (just that you don't need to set rm.Visible as it is ignored anyway).

 

Sorry, I haven't got an example handy but if you get stuck then just post a reply.

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 8/31/2008 9:28:24 AM

RE: OPEN FILE IN REVISION MANAGER

 

THANKS, Callum

finally it works! Now I'm fighting with opening DFT in RM, make the copy of the model .PAR and the drawing .DFT and open the model .PAR in SE to modify the variables. It works but now my problem consists in closing the files in SE saving the changes...

Private Sub CommandButton4_Click()

Dim se As Object

Dim separt As Object

Dim rm               As Object

Dim doc              As Object

Dim doccopy As Object

Dim links            As Object

Dim linkpart As Object

Dim linkpartcopy As Object

Dim n                As Integer

Dim ordre As Integer

Dim objVariables As Object

Dim ampini As Integer

Set se = GetObject("", "solidedge.Application")

se.Visible = True

Set rm = GetObject("", "RevisionManager.Application")

rm.Visible = True

Set doc = rm.Open("my file.dft")

ampini = 1000

For ordre = 1 To 5

doc.Copy ("my file" & -ordre & ".dft")

Set links = doc.LinkedDocuments

n = links.Count

Set linkpart = links.Item(1)

linkpart.Copy ("my file" & -ordre & ".par")

'Get the Documents collection

Set separt = se.Documents

'Open an existing file

Call separt.Open("my file" & -ordre & ".par")

Set objVariables = se.ActiveDocument.Variables

Call objVariables.Edit("AMPLADA_CINTA", ampini)

ampini = ampini + 500

Call separt.Close

Next

End Sub

That's mainly a COPY/PASTE from multiple resources so don't laugh...

Do you have any solution! My problem is in the end of the code... Of course, any suggestion to improve the code will be wellcome.

ALFONS

 

Posted by: alfons morral
Post date: 9/1/2008 3:51:13 AM