Code freezes when adding a RuledSurfaceFeature but does not freeze when stepping through

Code freezes when adding a RuledSurfaceFeature but does not freeze when stepping through

johnPGNFG
Enthusiast Enthusiast
144 Views
0 Replies
Message 1 of 1

Code freezes when adding a RuledSurfaceFeature but does not freeze when stepping through

johnPGNFG
Enthusiast
Enthusiast

Hi all!

I'm having trouble adding a RuledSurfaceDefinition to RuledSurfaceFeatures.  I make a list of ruledSurfaceDefinitions and then I use a foreach loop to add each one to the RuledSurfaceFeatures.  It always adds the first one no problem and then it throws an error when it tries to add the next one.  This doesn't happen all the time though.  Sometimes the code runs fine and others times it freezes when it tries to add the second one.  It also works fine if I put a breakpoint on the foreach loop and step through it.  I'm repeating this on the same part so everything is the same each time. Thoughts?

 

RuledSurfaceFeatures rsf = oCompDef.Features.RuledSurfaceFeatures;

 

foreach(RuledSurfaceDefinition rsd in ruledSurfaceDefinitionList)
{
rsf.Add(rsd);

}

 

 

 

Screenshot 2022-09-07 220509.png

0 Likes
145 Views
0 Replies
Replies (0)