Flattening a circular Sheet via API

Valued Contributor
Valued Contributor

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

2 REPLIES

Re: Flattening a circular Sheet via API

Valued Contributor
Valued Contributor

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.

Re: Flattening a circular Sheet via API

Valued Contributor
Valued Contributor

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.