Update draft views

Hello everybody,

 

Is thear a code to update a dft?

 

Regards,

 

Mariano

 

Posted by: Mariano Spini
Post date: 10/11/2010 1:27:22 PM

6 REPLIES

RE: Update draft views

Assuming the ActiveDocument is a Draft:

 

Application -> ActiveDocument -> ActiveSheet ->DrawingViews(n) -> Update

 

You can use DraftDocument -> Sections -> WorkingSection if you need to only look at WorkingSections.

 

Posted by: Jason Newell
Post date: 10/11/2010 1:40:08 PM

RE: Update draft views

Ok, but is there any code to update all the draft file?

Samething like startcommand or similar that execute the same function as the icon?

I also need to fit the view.

 

Regards,

Mariano

 

Posted by: Mariano Spini
Post date: 10/11/2010 1:58:30 PM

RE: Update draft views

I'm not sure if it's exactly the same with Draft but this is what I use with models.

 

Dim oApp As SolidEdgeFramework.Application

Dim oDoc As SolidEdgeAssembly.AssemblyDocument

Dim fit_window As Object

 

'Connect to the running instance of Solid Edge.

oApp = Marshal.GetActiveObject("SolidEdge.Application")

'Open the file.

oDoc = oApp.Documents.Open("file_path\file_name.asm)

 

'Update the model.

oDoc.ActivateAll()

oDoc.UpdateAll()

 

'Fit to window so you can see the whole thing.

fit_window = oApp.ActiveWindow

fit_window.View.Fit()

 

HTH

 

 

Posted by: Terry Tyson
Post date: 10/12/2010 3:34:58 AM

RE: Update draft views

It doesn't work.

 

I also try the line:

 

Call objApp.StartCommand(PartCommandConstants.PartViewISOView)

 

But it works well under windows Xp but it doen't work under windows 7.

Any idea?

 

Regards,

Mariano

 

Posted by: Mariano Spini
Post date: 10/12/2010 4:31:31 PM

RE: Update draft views

This should work. It's a small modification of the help example: Modellink.UpdateViews

HTH,

Julian

 

Set objDoc = objApp.Documents.Open(Filename:=TESTFILE)

'Update All Drawing views associated with all ModelLinks using UpdateViews method

 

 

For each objModellink in objdoc.Modellinks

    objModelLink.UpdateViews

next

 

' USER DISPLAY

' Release objects

Set objApp = Nothing

Set objDoc = Nothing

Set objModelLink = Nothing

End Sub

 

Posted by: Julian Guillo
Post date: 10/13/2010 2:15:17 AM

RE: Update draft views

Excelent!!!! It works!

 

But I doesn't update the Bill of material (BOM).

 

Any advice?

 

And how to fit the view?

 

Thanks you in advance!!!!

Mariano

 

Posted by: Mariano Spini
Post date: 10/14/2010 5:20:05 PM