×
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

Vectors in NX Open

Vectors in NX Open

Vectors in NX Open

(OP)
I'm learning NX Open in Unigraphics NX 4.  Whenever I use a function that returns a vector the plugin crashes when the vector goes out of scope.  Some of the code I'm working with is:

CODE

for(NXOpen::SketchCollection::iterator i = sketches->begin(); i != sketches->end(); ++i)
{
    log->WriteLine("\nIteration over this sketch.");
    (*i)->initialize();
    log->WriteLine((*i)->Name());
    (*i)->Activate(NXOpen::Sketch::ViewReorientTrue);

    std::vector<NXOpen::NXObject *> geometry = (*i)->GetAllGeometry();
}

When geometry goes out of scope, the plugin crashes with the following output to the log:

CODE --> NX Log File

*** EXCEPTION: INTERNAL ERROR in line 2180 of O:\ugnx402\ip2\src\syss\error\ind\error.cxx at Fri Oct 05 10:44:03 2007 Mountain Daylight Time
+++ Breakpoint hit, possible use of uninitialized variable?
[ 1] 097A5EE9 dbgdel\operator delete Line 52 +0x99                         (Test1)
[ 2] 097A273C xmemory\std::allocator<NXOpen::NXObject *>::deallocate Line 132 +0x2c (Test1)
[ 3] 097A2671 vector\std::vector<NXOpen::NXObject *,std::allocator<NXOpen::NXObject *> >::begin Line 797 +0x41 (Test1)
[ 4] 097A25FB vector\std::vector<NXOpen::NXObject *,std::allocator<NXOpen::NXObject *> >::~vector<NXOpen::NXObject *,std::allocator<NXOpen::NXObject *> > Line 389 +0x2b (Test1)
[ 5] 097BFCE7 test1\ufusr Line 57 +0x3c7                                   (Test1)
[ 6] 20362036                                                              (libsyss)
[ 7] 2036318E                                                              (libsyss)
[ 8] 203FF997                                                              (libsyss)
[ 9] 2490DCB0                                                              (libpartmodl)
[10] 2490E0D0                                                              (libpartmodl)
[11] 27913394                                                              (libcamsint)
[12] 2013149D                                                              (libuginitint)
[13] 00EE26F7                                                              (libugui)
[14] 00EE2BC7                                                              (libugui)
[15] 00EE2D02                                                              (libugui)
[16] 00EE2D78                                                              (libugui)
[17] 00EE9EA2                                                              (libugui)
[18] 00E51705                                                              (libugui)
[19] 01A0CEF3                                                              (windowsui)
[20] 01A0D08A                                                              (windowsui)
[21] 02AA03CB                                                              ()
>>>> INTERNAL ERROR caught in file "O:\ugnx402\ip2\src\syss\no\ind\lmldr.c" at line number 1002
>>>> INTERNAL ERROR caught in file "O:\ugnx402\ip2\src\syss\shar\ind\sys.c" at line number 1160
>>>> INTERNAL ERROR caught in file "O:\ugnx402\ip2\src\partmodl\no\ind\ufexit_ruf.c" at line number 537

I'm confused as to why this does not work and was wondering if anyone could point out what I'm missing and how to fix it.  Thanks.

RE: Vectors in NX Open

(OP)
Ok, some aditional information.  When I change from Debug libraries to Release libraries in VS7.1, I don't get the crash.  I don't know why I don't get the crash, but that scares me.

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