Cancel
Showing results for 
Search instead for 
Did you mean: 

RE: How to open a Document silently in SolidEdge

Valued Contributor
Valued Contributor

Avi,

Windows exists also at document level which is the solution i proposed you.

I tested my solution and it works well. (Code is VB.net now). You must just translate this into C++

 

 

Dim SEApp As SolidEdgeFramework.Application

Dim oPart As SolidEdgePart.PartDocument

Dim oWIn As SolidEdgeFramework.Window

 

'Get Solid Edge instance. Solid Edge must be open.

SEApp = GetObject(, "SolidEdge.Application")

 

oPart = SEApp.ActiveDocument 'A part document must be active

oWIn = oPart.Windows.Item(1) 'Get the first window for this document

 

oWIn.Visible = False 'Make it invisible

 

oWIn = Nothing

oPart = Nothing

SEApp = Nothing

 

 

Posted by: Julian Guillo
Post date: 7/22/2009 4:08:12 AM

RE: How to open a Document silently in SolidEdge

Valued Contributor
Valued Contributor

 

Avi,

you may use the following code, which has already worked for me in the past.DocumentsPtr pDocs = pApp->GetDocuments();

VARIANT vOption;

V_VT( &vOption ) = VT_UI4;

V_UI4( &vOption ) = (unsigned long)8L;

DocumentPtr pNewDoc = pDocs->Open( strDocName, vOption );

 

The option code 8 avoids creating a window for the new document.

 

Good luck,

Martin

 

Posted by: Martin Bernhard
Post date: 7/24/2009 12:45:53 AM

RE: How to open a Document silently in SolidEdge

Valued Contributor
Valued Contributor

 

Thanks a lot Martin for the Solution It worked perfectly well the way I wanted.

I made a small change here, Instead of using DocumentPtr, I used IDispatchPtr and then typecated it to get the respective pointer.

Thanks Again Martin.

Regards,

Avi

 

Posted by: rajesh panda
Post date: 7/27/2009 1:25:34 AM

RE: How to open a Document silently in SolidEdge

Valued Contributor
Valued Contributor

Hi,

DocumentPtr pNewDoc = pDocs->Open( strDocName, vOption );

After using the above code the .par documents are opened silently but the sub-assemblies are still visible in the solid edge application when trying to open silently using above code.

 

Also, the assmebly document (.asm) is opened in cascade form within solidedge application and not in fully maximized form. so problem is

1) How to open sub-assemblies in invisible mode?

2) even if it opens in visible mode how to open in maximized form, rather than cascaded form.

 

Thanks & Regards

Amey

 

Posted by: amey k
Post date: 11/15/2009 3:42:58 AM