Editing a Normalcutout

Experimenter
Experimenter

Hello, I'm editing an existing NormalCutout in the model.

All I'm doing is adding another square feature, with its relations, to the cutout. When  I finish and open the file with SolidEdge, the normalCutout shows a problem.

When I manually click "Edit Profile" on the cutout, and immediately close the profile (without changing anything), the cutout works fine with the new hole I created. Why is that? How can I get it to work without having to open the profile myself?

 

This is the code:

 

NormalCutout cut = part.Models.Item(1).NormalCutouts.Item(1);

var arr3 = Array.CreateInstance(typeof(Profile), 1);

arr3.SetValue(newProfile, 0);

int a = 0;

cut.GetProfiles(out a, ref arr3);

newProfile = arr3.GetValue(0) as Profile;

 

var line1 = newProfile.Lines2d.AddBy2Points(-0.209601712937375, 0.194496683115664, -0.129926736741552, 0.194496683115664);

var line2 = newProfile.Lines2d.AddBy2Points(-0.129926736741552, 0.194496683115664, -0.129926736741552, 0.289347845253548);

var line3 = newProfile.Lines2d.AddBy2Points(-0.129926736741552, 0.289347845253548, -0.209601712937375, 0.289347845253548);

var line4 = newProfile.Lines2d.AddBy2Points(-0.209601712937375, 0.289347845253548, -0.209601712937375, 0.194496683115664);

 

newProfile.Relations2d.AddKeypoint(line1, 1, line2, 0);

newProfile.Relations2d.AddKeypoint(line2, 1, line3, 0);

newProfile.Relations2d.AddKeypoint(line3, 1, line4, 0);

newProfile.Relations2d.AddKeypoint(line4, 1, line1, 0);

 

part.Save();

 

Thanks!

 

 

1 REPLY

Re: Editing a Normalcutout

Experimenter
Experimenter

Found the problem.

Should have called End() method to the profile.