×
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

NXOpen-FitCurve

NXOpen-FitCurve

NXOpen-FitCurve

(OP)
I just find an interesting thing.
I record the fitting curve process using c#.
The final part of the code is like below.
.....
NXObject nXObject7;
nXObject7 = fitCurveBuilder1.Commit();
......

If you run the code, you get a fit curve feature in the feature tree.
But unlike other "builder.commit", the result (nXObject7) of this "fitCurveBuilder.Commit" is "null".
Whenever you use this "nXObject7", for example, string a=nXObject7.JournalIdentifier, you will get "System.NullReferenceException: Object reference not set to an instance of an object" error.

Does anyone knows what happens here?
Thank you.

RE: NXOpen-FitCurve

(OP)
I have tried several situations and all got the same result.

A simple test:
if (fitCurveBuilder1.Commit() == null)
{
lw.WriteLine("aaaaaaaaaaaaa");
}

Then you do get "aaaaaaaaaaaaaa".
But there is a fit curve feature created in the feature tree.

RE: NXOpen-FitCurve

The commit method for fitcurvebuilder indicates that "Commits any edits that have been applied to the builder". If you want to access the fitcurve feature then use the CommitFeature method.

RE: NXOpen-FitCurve

(OP)
Hi FranKSwinks,

Thank you.
I have tried it, but the feature you get from "fitCurveBuilder.CommitFeature()" is still "null".
I never met this kind of problem before.

RE: NXOpen-FitCurve

It may be a bug in the API. I'd suggest creating a small journal that shows the problem and sending it to GTAC for them to look into it.

www.nxjournaling.com

RE: NXOpen-FitCurve

I took another look at this. First I assume you are using NX8.5? My code is using VB.

After the fitcurve has been created you can get the feature like this

Dim fitcurvefeat As features.feature = fitCurveBuilder1.getfeature

Hope this helps.

Frank Swinkels

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