Message 1 of 3
Flat pattern as SAT file in C code (Inventor9)
Not applicable
07-21-2004
10:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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->GetFlatPattern()->GetBody();
osb->GetDataIO()->WriteDataToFile(formatsat, filename);
and you get a compile error - no such member of surfacebodyptr.
If you go the other route, and say
osb->GetComponentDefinition()->GetDataIO()->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-