- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I wanted to do something similar but I never found a good solution. If I need to find a point both in the flatpattern and the folded model then I make a very small hole in the folded model at the point that I need to find. Then I look op that hole in the flatpattern. (If anyone knows a better solution I would like to know about it.) But I see that you want text. If you are working with Inventor 2023 or newer that you have a special command for this. Have a look at the Mark command.
https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-8B8DD53E-2E54-43D4-8E7B-7B90CAEB4BFA
It has some interesting extra options.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Creating a small hole was my next idea but that seems like such a goofy way to go about this. The software I am writing will be used by customers so there's no guarantee they will have 2023 but it's good to know that is an option now! I'll play around with it, thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is very easy job. ![]()
Sketch in sheetmetal part has option PlanarSketch.CopyToFlatPattern Property
This can be set manually or using API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report