Solved! Go to solution

Flattening a circular Sheet via API

I was trying to improve one of the several pieces of code I found on the forum that flatten sheets. Those pieces of code don´t flatten circular sheets. I use flatpatternmodel.flatpatterns.add(largestedge, objBiggestface, largestedge.endvertex, solidedgeconstants.flattenpatternmodeltypeconstants.igflattenpatternmodeltypeflattenanything)


I changed the largestedge to be a circular edge if there´s is no linear edge on the model, but does anybody have a clue about the vertex I have to use? since a circular edge doesn´t have start or end points. 



Best wishes

Ramon Ruiz


Re: Flattening a circular Sheet via API

Maybe I didn´t explained myself but I was talking about a flat sheet where there´s no linear edges cos the outside shape is a circle.

Accepted by topic author RamonRuiz
‎05-14-2017 02:38 PM

Re: Flattening a circular Sheet via API

I finally found a way to auto-flatten a sheet with no linear-edges. The problem was obvious, I didn´t have a linear edge so no vertex to use the method. 


The solution was not so obviuos, I used this


flatPatternModel.FlatPatterns.Add(ReferenceEdge:=LargestEdge, ReferenceFace:=objBiggestFace, ReferenceVertex:=LargestEdge, ModelType:=SolidEdgeConstants.FlattenPatternModelTypeConstants.igFlattenPatternModelTypeFlattenAnything)


It´s odd but using as the referencevertex the referenceedge the method works.