Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to unbend and rebend ?

Experimenter
Experimenter

Hello All,

I need to unbend and rebend a flange,

But I have no idea about how to specifies the planar face and bend.

Please give me some suggestions 

 

Thanks & Regards

 

2018-07-10_16-01-16.png

 

6 REPLIES

Re: How to unbend and rebend ?

Phenom
Phenom

You need to create two object, one for the face and one for the bend feature.

Then set face object by choose the wanted face in the face collection same for the bend object.

Pass the two object to the add method.

 

The difficult part here is to identify the face you want to choose, what is your criteria ?

Re: How to unbend and rebend ?

Experimenter
Experimenter

 

HI Fiorini

Thanks for your reply,

I want to unbend Flange 2, but i still have no idea about how to set the object of pFace and pBends,

This is my current code, appreciate for your help.

 

2018-07-14_23-46-13.png

 

// Get Active Document
                sheetMetalDocument = (SheetMetalDocument)seApplication.ActiveDocument;

                // Plane
                refPlanes = sheetMetalDocument.RefPlanes;
                refPlane = refPlanes.Item(1);

                // Sketch & Profile
                sketchs = sheetMetalDocument.Sketches;
                sketch = sketchs.Add();
                profiles = sketch.Profiles;
                profile = profiles.Add(refPlane);

                // Line
                lines2D = (Lines2d)profile.Lines2d;

                lines2D.AddBy2Points(0, 0, 0.1, 0);
                lines2D.AddBy2Points(0.1, 0, 0.1, 0.1);
                lines2D.AddBy2Points(0.1, 0.1, 0, 0.1);
                lines2D.AddBy2Points(0, 0.1, 0, 0);
                
                // Close profile
                profile.End(SolidEdgePart.ProfileValidationType.igProfileClosed);

                // Get models collection
                models = sheetMetalDocument.Models;

                // Add Tab
                models.AddBaseTab(
                    Profile: profile,
                    ExtentSide: SolidEdgePart.FeaturePropertyConstants.igRight
                    );
                
                // Specify the model
                model = models.Item(1);

                // Body
                body = (Body)model.Body;

                // Get face
                faces = (Faces)body.Faces[SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryPlane];     // Only planer faces
                face = (Face)faces.Item(1);
                
                // Get edge
                edges = (Edges)face.Edges;

                // Get flanges collection
                flanges = model.Flanges;

                // Create flange
                flange = flanges.Add(
                    pLocatedEdge: edges.Item(1),        // Select the edge
                    FlangeSide: SolidEdgePart.FeaturePropertyConstants.igRight,     // Direction of Flange
                    FlangeLength: 0.02,                                             // Flange length in meters
                    ThicknessSide: SolidEdgePart.FeaturePropertyConstants.igOutside,    // Meterial side, inside, outside
                    DimSide: SolidEdgePart.FeaturePropertyConstants.igOutsideDimension, // Dimension side, in, out
                    OffsetType: SolidEdgePart.FeaturePropertyConstants.igNone           // Offset type, in this case, don`t have offset
                    );
                 
                // Hide the dimension,line and profile
                flange.ShowDimensions = false;

                // Bend                
                bends = model.Bends;
                bend = bends.Item(1);

                // Unbend
                unbends = model.Unbends;                
                unbend = unbends.Add(face, bend);

 

 

 

 

Re: How to unbend and rebend ?

Phenom
Phenom

Have a look at the "Flange" feature, it has an object called "Faces" and an object callet "Edges" they both have the "Get" method.

 

ActiveDocument.Models.Item(1).Flanges.Item(1).Faces

ActiveDocument.Models.Item(1).Flanges.Item(1).Edges

 

I would choose the face that has the biggest area and the edge that has the maximum lenght

 

Re: How to unbend and rebend ?

Experimenter
Experimenter

Thanks for your suggestion, but still not successful at the moment,

please take a look at my code, and give me more suggestion no matter VB or C#.

 

faces = (Faces)flange.Faces[SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryPlane];
face = (Face)faces.Item(1);

edges = (Edges)flange.Edges[SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryPlane]; edge = (Edge)edges.Item(1); // Unbend unbends = model.Unbends; unbend = unbends.Add(faces, edges);

 

 

Re: How to unbend and rebend ?

Phenom
Phenom

I don't know if this solves the problem but this is the correct line:

unbend = unbends.Add(face, edge);   

 

 

Re: How to unbend and rebend ?

Experimenter
Experimenter

When I run the code, It`s doing nothing, I think the object of face and edge is still wrong, is it possible use faceset to specify?

1.png2.png