Reply

SolidEdge to Pdf

[ Edited ]

 

Hello,

first, congratulations for this site

I need to write a c# program for SolidEdge v20, this program must launch SolidEdge, open a file in Draft mode and print the drawing using PDFCreator.

I downloaded your example "CSharpDemo" but it seems to me  that this program works only if SolidEdge is already launched.

I'm a beginner with SolidEdge and c# and i've difficulties to find help about these topics, then... each information is welcome

Thank you for answer

Best regards.

 

Posted by: Thierry Maire
Post date: 1/22/2008 1:17:30 AM

5 REPLIES

RE: SolidEdge to Pdf

[ Edited ]

 

wow ! After one week... no answer

Is my question so difficult ?

 

Posted by: Thierry Maire
Post date: 1/25/2008 10:21:08 PM

RE: SolidEdge to Pdf

[ Edited ]

 

Hi Man,

Sorry, missed your first post. Here's some code to start solid edge, after that you'll need to use the Open method of the Application classes Documents collection. This should get you started, then see how you go with printing (haven't got any examples for this, sorry)

 C#Smiley Tonguerivate void button1_Click(object sender, EventArgs e){    try    {        // Get the type for a Solid Edge Application object     Type solidEdgeType =         Type.GetTypeFromProgID("SolidEdge.Application");     // Start Solid Edge     SolidEdgeFramework.Application solidEdge =     (SolidEdgeFramework.Application)Activator.CreateInstance(solidEdgeType);     // Maximise Solid Edge     solidEdge.WindowState =     (int)System.Windows.Forms.FormWindowState.Maximized;     /* it is also possible to use the integer 2     * but the use of the Maximised enumeration     * value above is clearer */     // Make Solid Edge Visible     solidEdge.Visible = true;    // Do stuff here    }     finally    {        // Release Solid Edge

        System.Runtime.InteropServices.Marshal.ReleaseComObject(solidEdge);    }

}Cheers

Calum

 

Posted by: Calum McLellan
Post date: 1/26/2008 9:40:41 AM

RE: SolidEdge to Pdf

[ Edited ]

 

Thank you very much Calum,

I try it today

I've still 2 other questions :

1) how can I do a "Fit" having load the drawing ?

2) I need to get all the "Groups" of the drawing, and impossible to understand how works the class hierarchy of SolidEdge What is the type of the array which will receive the Group objects ?

Thank you for answer

Best regards

 

 

 

Posted by: Thierry Maire
Post date: 1/27/2008 4:40:44 PM

RE: SolidEdge to Pdf

[ Edited ]

 

Not sure about the second question, but as for a "FitAll":

 

This is with VB6:

Set objApp = GetObject(, "SolidEdge.Application")

Call objApp.ActiveWindow.FitEx(igFitAll)

 

 - Bill

 

Posted by: Bill Ledbetter
Post date: 1/28/2008 12:36:53 AM

RE: SolidEdge to Pdf

[ Edited ]

Posted By Calum McLellan on 01/26/2008 3:40 PM

 

 

 C#:

private void button1_Click(object sender, EventArgs e)

{

    try

    {

        // Get the type for a Solid Edge Application object

    Type solidEdgeType =

        Type.GetTypeFromProgID("SolidEdge.Application");

    // Start Solid Edge

    SolidEdgeFramework.Application solidEdge =

    (SolidEdgeFramework.Application)Activator.CreateInstance(solidEdgeType);

    // Maximise Solid Edge

    solidEdge.WindowState =

    (int)System.Windows.Forms.FormWindowState.Maximized;

    /* it is also possible to use the integer 2

    * but the use of the Maximised enumeration

    * value above is clearer */

    // Make Solid Edge Visible

    solidEdge.Visible = true;

 

    // Do stuff here

 

    }

    finally

    {

        // Release Solid Edge

        System.Runtime.InteropServices.Marshal.ReleaseComObject(solidEdge);

    }

}

 

Hi,

I use a code like this for convert a dft to PDF with funtion saveAs.

If i put the visible property to true, the conversion runs correctly, but if i put the value to false, doesn't work.

Why? any idea? is necessary taht the application is visible?

I use solid Edge v20.

 

Best Regards,

Gerard Lopez.

 

Posted by: Gerard Lopez
Post date: 5/6/2009 10:44:29 PM