Example to SaveAs *.sat file in c#

Valued Contributor
Valued Contributor

Any quick example to do this?

1 REPLY

Re: Example to SaveAs *.sat file in c#

Phenom
Phenom

Change the extension of the document and send it to SaveAs:

 

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace Export_SE_STL
{
    class Program
    {
        static void Main(string[] args)
        {
            SolidEdgeFramework.Application oApp = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application");
            SolidEdgePart.PartDocument oDoc = (SolidEdgePart.PartDocument)oApp.ActiveDocument;

            string sPartFilename = oDoc.FullName;
            string sStlFilename = sPartFilename.Replace(".par", ".stl");

            oDoc.SaveAs(sStlFilename);
        }
    }
}

The settings for the SAT generated will depend on these settings in the interactive SaveAs options box:

 

Untitled.png

 

~Tushar

http://surfandcode.blogspot.in