Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Self intersecting section error while running *.cs file

Status
Not open for further replies.

nithinv

Mechanical
Mar 21, 2015
26
0
0
IN
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.
 
 http://files.engineering.com/getfile.aspx?folder=d9e2f5e7-ea1b-4209-b5cf-ca5ec475169d&file=journal.JPG
Replies continue below

Recommended for you

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
 
 http://files.engineering.com/getfile.aspx?folder=cf2c9627-e1d9-433d-b197-9450ea6410c9&file=1691_2.cs
Status
Not open for further replies.
Back
Top