I want to create a drawing with a view of the folded model and a view of the flatpattern of the same sheetmetal part.
the problem with this is that the flatpattern is flipt compared to the model view.
To get this rigth you have to manipulate the flat pattern in the 3D model, but my question is can it be done in the drawing with VB.net,
is there a way, with VB, to compair the orientation, maybe X,Y and Z, from the flatpattern to the part? so you know how to flip or rotate the flatpattern, so it matches the model view orientation?
This functionality was added in the Inventor 2015:
http://modthemachine.typepad.com/my_weblog/2014/04/inventor-2015-api-enhancements.html
Here is the VBA sample:
Public Sub SheetMetalOrientFlat() Dim partDoc As PartDocument Set partDoc = ThisApplication.ActiveDocument Dim smDef As SheetMetalComponentDefinition Set smDef = partDoc.ComponentDefinition If Not smDef.HasFlatPattern Then smDef.Unfold End If Dim orientation As FlatPatternOrientation Set orientation = smDef.FlatPattern.FlatPatternOrientations.ActiveFlatPatternOrientation.Copy("New Orientation") ' Find an linear edge that lies along the flattened plane. Dim flatEdge As Edge Dim tempEdge As Edge For Each tempEdge In smDef.FlatPattern.Body.Edges If tempEdge.GeometryType = kLineSegmentCurve Then If Abs(tempEdge.StartVertex.Point.Z - tempEdge.StopVertex.Point.Z) < 0.0001 Then Set flatEdge = tempEdge Exit For End If End If Next orientation.Activate orientation.AlignmentRotation.Expression = "30 deg" orientation.AlignmentAxis = flatEdge End Sub
cheers,
Thanks Vladimir,
I'm still working on 2014, but will install 2015 soon, then I will try your solution.
thanks again!