- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm exporting sheet metal parts as flat patterns using the api. I have no problem unfolding the part and finding all the operations (holes, slots, outter edges, etc) but I need to export the position of text on the part as well. The problem is text doesn't show up in the flat pattern and it appears Inventor doesn't attempt to figure out where the text would land in the flat pattern. From my research, only brep objects are transferred to the flat pattern. The method FlatPattern.GetFlatPatternEntity() seemed promising at first. I converted the text origin into a 3d point and and input that into the method with no luck. I tried creating a workpoint at the text origin and that didn't work either. Both returned null. Is there something I'm missing? It doesn't make sense to me that I can input an edge, GetFlatPatternEntity(edge), and get back the edge in the flat pattern along with the position of it's end points but I can't ask where a specific point on a face will end up in the flat pattern.
foreach (Inventor.TextBox text in sketch.TextBoxes)
{
Inventor.Point2d textOrigin = text.Origin;
PlanarSketch pSketch = (PlanarSketch)sketch;
Inventor.Point2d textOriginCopy = textOrigin.Copy();
Inventor.Point textOrigin3d = pSketch.SketchToModelSpace(textOriginCopy);
Inventor.Point textOrigin3dcopy = textOrigin3d.Copy();
WorkPoint textOrigin3dwork = partDoc.ComponentDefinition.WorkPoints.AddFixed(textOrigin3dcopy);
object flatPoint1 = (object)sheetdef.FlatPattern.GetFlatPatternEntity(textOrigin3dcopy); //returns null
object flatPoint2 = (object)sheetdef.FlatPattern.GetFlatPatternEntity(textOrigin3dwork); //returns null
}
Solved! Go to Solution.