×
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

File saving issue in NXOpen external program in NX 7.5

File saving issue in NXOpen external program in NX 7.5

File saving issue in NXOpen external program in NX 7.5

(OP)
Hi All,
I have created a NXOpen external program to open a part file and execute some operations and save as in another file name. This application is getting error in one particular system. The error is it could not able to save as or save the opened part file if folder length is more than 130 characters. It is saving if folder length less than 130 characters. when I try in interactive mode (File > Execute > NXOpen) it is saving fine if more than 130 character also. I am using maximum 24 character including extension for file name.
NXOpen.NXException: Internal error: memory access violation - This is the exception i am getting when i run the external program.

Here I have three questions.
1. Why only that particular system is getting this error.
2. Application saves the file when I run in interactive mode if folder length is more than 130 characters. Why external application gets fail?
3. Is it related to windows issue?


Thanks,
Selvaraj C
NX Automation Engineer.

RE: File saving issue in NXOpen external program in NX 7.5

I don't know if this is what you are running into, but I found this in the API reference docs:

Quote (uf_cfi.html)

The following are the restrictions on the length of various items:

File Names are limited to UF_CFI_MAX_FILE_NAME_NCHARS characters
File Extensions are limited to 4 characters
Directory specifications are limited to MAX_FSPEC_NCHARS
characters
Full file specifications are limited to MAX_FSPEC_NCHARS
characters

Also, this:

Quote (uf_cfi_types.html)

*/
/***************************************************************************
* Limit definitions
*
* UF_CFI_MAX_FILE_NAME_LEN, UF_CFI_MAX_FILE_NAME_SIZE, UF_CFI_MAX_PATH_NAME_LEN,
* UF_CFI_MAX_PATH_NAME_SIZE are all being deprecated because NX is moving to
* support multibyte characters. User written programs should start using the
* new definitions for file specifications and simple file names:
* CFI_MAX_FILE_NAME_BUFSIZE
* MAX_FSPEC_BUFSIZE should be used for buffer allocations and memory
* allocations, e.g. char my_fspec[MAX_FSPEC_BUFSIZE];
* CFI_MAX_FILE_NAME_NCHARS
* MAX_FSPEC_NCHARS should be used to limit the number of characters
* in a buffer. NX code will enforce these limits.
*
* MAX_FSPEC_BUFSIZE and MAX_FSPEC_NCHARS are defined in uf_defs.h.
*
* New routines have been added which will help in this transition:
* UF_TEXT_count_characters() will count the number of characters in a
* buffer.
* UF_TEXT_terminate_chars() will terminate a C string after the given
* number of characters.
*/

www.nxjournaling.com

RE: File saving issue in NXOpen external program in NX 7.5

You don't say what version of NX you are using, but I found for my NX8.5 installation that MAX_FSPEC_SIZE is set to 256, so 130 characters should not be a problem.
Not sure what language you are developing in either, but are you sure you have declared the variable holding the save-as file specification large enough to hold your 130+ character path?

Graham Inchley, Systems Developer, Sandvik Coromant. www.sandvik.com
HP EliteBook 8760w, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX6.0.5.3 MP5
Testing: NX8.5.3.3 MP4 64bit | NX9.0.2.5

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