<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Flat pattern as SAT file in C code (Inventor9) in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086931#M165815</link>
    <description>No reason why this shouldn't work with C++ code. Can you make sure that you
have the correct typelibrary? Have you tried the VBA code and that works?

Sanjay-

"bd" &lt;BRIAN&gt; wrote in message news:40fea7d6$1_3@newsprd01...
&amp;gt; It's possible to save the sheet metal flat pattern to a .sat file in V9.
&amp;gt; below is a VBA sample that does it
&amp;gt;
&amp;gt; How do i do the same in C/C++ code?
&amp;gt;
&amp;gt; The tricky vba line seems to be the     Call
&amp;gt; oSB.DataIO.WriteDataToFile("ACIS SAT", "C:\TEMP\satfile.sat")
&amp;gt; If i do that in C code, the translation is (?)
&amp;gt;     SurfaceBodyPtr osb = smptr-&amp;gt;GetFlatPattern()-&amp;gt;GetBody();
&amp;gt;     osb-&amp;gt;GetDataIO()-&amp;gt;WriteDataToFile(formatsat, filename);
&amp;gt;
&amp;gt; and you get a compile error - no such member of surfacebodyptr.
&amp;gt; If you go the other route, and say
&amp;gt; osb-&amp;gt;GetComponentDefinition()-&amp;gt;GetDataIO()-&amp;gt;WriteDataToFile(formatsat,
&amp;gt; filename);
&amp;gt;
&amp;gt; GetComponentDefinition() returns the 'regular' component def and you get
&amp;gt; the non-flattened body written to your file....
&amp;gt; i'm confused...is this only supported in basic?
&amp;gt; bd
&amp;gt;
&amp;gt; --------
&amp;gt; Yes, this is possible to do in R9. Here is a VBA sample that does this.
Have
&amp;gt; a sheet metal document open (with a flat pattern generated) before running
&amp;gt; this.
&amp;gt;
&amp;gt; Sub FlatPatternToSAT()
&amp;gt;     Dim oDoc As PartDocument
&amp;gt;     Set oDoc = ThisApplication.ActiveDocument
&amp;gt;
&amp;gt;     Dim oCD As SheetMetalComponentDefinition
&amp;gt;     Set oCD = oDoc.ComponentDefinition
&amp;gt;
&amp;gt;     Dim oSB As SurfaceBody
&amp;gt;     Set oSB = oCD.FlatPattern.Body
&amp;gt;
&amp;gt;     Call oSB.DataIO.WriteDataToFile("ACIS SAT", "C:\TEMP\satfile.sat")
&amp;gt; End Sub
&amp;gt;
&amp;gt; Sanjay-
&amp;gt;
&amp;gt;&lt;/BRIAN&gt;</description>
    <pubDate>Wed, 21 Jul 2004 18:26:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-07-21T18:26:15Z</dc:date>
    <item>
      <title>Flat pattern as SAT file in C code (Inventor9)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086930#M165814</link>
      <description>It's possible to save the sheet metal flat pattern to a .sat file in V9.
below is a VBA sample that does it

How do i do the same in C/C++ code?

The tricky vba line seems to be the     Call
oSB.DataIO.WriteDataToFile("ACIS SAT", "C:\TEMP\satfile.sat")
If i do that in C code, the translation is (?)
    SurfaceBodyPtr osb = smptr-&amp;gt;GetFlatPattern()-&amp;gt;GetBody();
    osb-&amp;gt;GetDataIO()-&amp;gt;WriteDataToFile(formatsat, filename);

and you get a compile error - no such member of surfacebodyptr.
If you go the other route, and say
osb-&amp;gt;GetComponentDefinition()-&amp;gt;GetDataIO()-&amp;gt;WriteDataToFile(formatsat,
filename);

GetComponentDefinition() returns the 'regular' component def and you get
the non-flattened body written to your file....
i'm confused...is this only supported in basic?
bd

--------
Yes, this is possible to do in R9. Here is a VBA sample that does this. Have
a sheet metal document open (with a flat pattern generated) before running
this.

Sub FlatPatternToSAT()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument

    Dim oCD As SheetMetalComponentDefinition
    Set oCD = oDoc.ComponentDefinition

    Dim oSB As SurfaceBody
    Set oSB = oCD.FlatPattern.Body

    Call oSB.DataIO.WriteDataToFile("ACIS SAT", "C:\TEMP\satfile.sat")
End Sub

Sanjay-</description>
      <pubDate>Wed, 21 Jul 2004 17:29:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086930#M165814</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-07-21T17:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Flat pattern as SAT file in C code (Inventor9)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086931#M165815</link>
      <description>No reason why this shouldn't work with C++ code. Can you make sure that you
have the correct typelibrary? Have you tried the VBA code and that works?

Sanjay-

"bd" &lt;BRIAN&gt; wrote in message news:40fea7d6$1_3@newsprd01...
&amp;gt; It's possible to save the sheet metal flat pattern to a .sat file in V9.
&amp;gt; below is a VBA sample that does it
&amp;gt;
&amp;gt; How do i do the same in C/C++ code?
&amp;gt;
&amp;gt; The tricky vba line seems to be the     Call
&amp;gt; oSB.DataIO.WriteDataToFile("ACIS SAT", "C:\TEMP\satfile.sat")
&amp;gt; If i do that in C code, the translation is (?)
&amp;gt;     SurfaceBodyPtr osb = smptr-&amp;gt;GetFlatPattern()-&amp;gt;GetBody();
&amp;gt;     osb-&amp;gt;GetDataIO()-&amp;gt;WriteDataToFile(formatsat, filename);
&amp;gt;
&amp;gt; and you get a compile error - no such member of surfacebodyptr.
&amp;gt; If you go the other route, and say
&amp;gt; osb-&amp;gt;GetComponentDefinition()-&amp;gt;GetDataIO()-&amp;gt;WriteDataToFile(formatsat,
&amp;gt; filename);
&amp;gt;
&amp;gt; GetComponentDefinition() returns the 'regular' component def and you get
&amp;gt; the non-flattened body written to your file....
&amp;gt; i'm confused...is this only supported in basic?
&amp;gt; bd
&amp;gt;
&amp;gt; --------
&amp;gt; Yes, this is possible to do in R9. Here is a VBA sample that does this.
Have
&amp;gt; a sheet metal document open (with a flat pattern generated) before running
&amp;gt; this.
&amp;gt;
&amp;gt; Sub FlatPatternToSAT()
&amp;gt;     Dim oDoc As PartDocument
&amp;gt;     Set oDoc = ThisApplication.ActiveDocument
&amp;gt;
&amp;gt;     Dim oCD As SheetMetalComponentDefinition
&amp;gt;     Set oCD = oDoc.ComponentDefinition
&amp;gt;
&amp;gt;     Dim oSB As SurfaceBody
&amp;gt;     Set oSB = oCD.FlatPattern.Body
&amp;gt;
&amp;gt;     Call oSB.DataIO.WriteDataToFile("ACIS SAT", "C:\TEMP\satfile.sat")
&amp;gt; End Sub
&amp;gt;
&amp;gt; Sanjay-
&amp;gt;
&amp;gt;&lt;/BRIAN&gt;</description>
      <pubDate>Wed, 21 Jul 2004 18:26:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086931#M165815</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-07-21T18:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Flat pattern as SAT file in C code (Inventor9)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086932#M165816</link>
      <description>I have tried this code in VB, and while it does produce an .sat file, the .sat file that it creates is different from what you get if you right click on the FlatPattern and Save Copy As .sat on the interface.&lt;BR /&gt;
&lt;BR /&gt;
For example, the attached ZIP contains the SAT files that result from using the sheet metal sample .ipt files included with Inventor 9.&lt;BR /&gt;
&lt;BR /&gt;
I have problems loading the .sat created from the API into other applications such as SolidWorks.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas why the files are different and what can be done to get the one from the API to match what is created from the Interface?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Dennis Martin&lt;BR /&gt;
DP Technology Corp</description>
      <pubDate>Tue, 03 Aug 2004 22:01:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/flat-pattern-as-sat-file-in-c-code-inventor9/m-p/1086932#M165816</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-08-03T22:01:17Z</dc:date>
    </item>
  </channel>
</rss>

