×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Self intersecting section error while running *.cs file

Self intersecting section error while running *.cs file

Self intersecting section error while running *.cs file

(OP)
Hi All,

I am running a journal file (*.cs) which is intended to create a standard part I use in my assembly. I got this file from the catalog software. This particular file runs smoothly for sometime but suddenly it stops showing an error. Screenshot of error message attached.

I don't know NX journal but as far as I understand the issue is extruding a section which has self intersecting curves. Could anybody help me to avoid this error?

Thanks in advance.

NV.

RE: Self intersecting section error while running *.cs file

A couple of quick ideas:
  • edit the code so that it does not create a self-intersecting section
  • edit the code so that it uses the "stop at intersection" option

www.nxjournaling.com

RE: Self intersecting section error while running *.cs file

(OP)
Dear Cowski,

Thanks. Below is the portion of *.cs file were error happened. Underlined line shows error. How to edit this so that extrude will either "select region boundary curves" or "stop at intersection"? I also have uploaded the *.cs file for your reference.

Thanks in advance.

NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)theSession.ActiveSketch.Feature;
features1[0] = sketchFeature1;
CurveFeatureRule curveFeatureRule1;
curveFeatureRule1 = workPart.ScRuleFactory.CreateRuleCurveFeature(features1);
section1.AllowSelfIntersection(false);
SelectionIntentRule[] rules1 = new SelectionIntentRule[1];
rules1[0] = curveFeatureRule1;
Sketch sketch1 = theSession.ActiveSketch;
NXObject nullNXObject = null;
Point3d helpPoint1 = new Point3d(0, 0 ,0);
if (sLine != null)
section1.AddToSection(rules1, sLine, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
else if (sArc != null)
section1.AddToSection(rules1, sArc, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
else
MessageBox.Show ("Error 214");
Direction direction1;
direction1 = workPart.Directions.CreateDirection(sketch1, Sense.Forward, NXOpen.SmartObject.UpdateOption.WithinModeling);
extrudeBuilder1.Direction = direction1;
extrudeBuilder1.ParentFeatureInternal = false;
NXOpen.Features.Feature feature1;
feature1 = extrudeBuilder1.CommitFeature();
//CodeAbove m_iObjectCounter = 6
vFeatureList[0,iFeatureCount] = "EXTRUDE(6)";
{
string sFeatureName = feature1.GetFeatureName();
int iPosBra1 = sFeatureName.IndexOf ("(");
int iPosBra2 = sFeatureName.IndexOf (")");
string sNumber = sFeatureName.Substring(iPosBra1+1, iPosBra2 - iPosBra1 - 1);
int iNumber = Convert.ToInt32 (sNumber);
vFeatureList[1,iFeatureCount] = "EXTRUDE(" + iNumber + ")";
vFeatureList[2,iFeatureCount] = "EXTRUDE(" + (iNumber-1) + ")";
vFeatureList[3,iFeatureCount] = "EXTRUDE(" + (iNumber+1) + ")";
iObjectCounter = iNumber;
}
iFeatureCount++;
iObjectCounter++;
Expression expression1 = extrudeBuilder1.Limits.StartExtend.Value;
Expression expression2 = extrudeBuilder1.Limits.EndExtend.Value;
extrudeBuilder1.Destroy();
}
theSession.ActiveSketch.Deactivate(NXOpen.Sketch.ViewReorient.True, NXOpen.Sketch.UpdateLevel.Model);
theSession.DeleteUndoMarksSetInTaskEnvironment();
theSession.EndTaskEnvironment();
} //Extr End m_iObjCounter 1
{ //Extr Begin m_iObjCounter = 1
//Extr Begin iSketchObj = 6
{ //CSYS => SketchPlane
// 3 Points for CSYS

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources