cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Why does Creo 2.0 care how long the file name is when creating a PDF

scott_rockwell
5-Regular Member

Why does Creo 2.0 care how long the file name is when creating a PDF

Did you ever wonder why ... ?
Whenever I create a PDF file from a drawing file with the PTC maximum file name length and I want to increase the length by adding "-rev_X" Creo always disallows it with an error message "Invalid Name. Filename is too long".
Why should Creo care at this point? I'm wanting to export to PDF format. Print to file will cause the same error.


[Quantum]

Scott Rockwell hardware engineering
720.249.5752 | Scott.Rockwell@Quantum.com<">mailto:Scott.Rockwell@Quantum.com> | Quantum.com

This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
6 REPLIES 6

How about renaming the PDF after it is "printed" or created? I know it adds a step but it's a work around. We use that at our company due to various software and their different naming conventions and restrictions.

Frank Lowry
Clearfield Inc.
Continuation Engineering
763-519-9845 Direct

[VCCsign3]

In software writing it is always a good idea to think about what can go
wrong (assuming the worst) and prevent it from happening if possible, or
otherwise prevent it from crashing your software. When a program asks
for input, the input is stored in a buffer. The buffer will have a
certain size. If the user can input something that is longer than the
buffer, things will go wrong, causing the program to crash (best case
scenario). So you can either try and make your buffers very big (but you
will still need to set a limit) or set a max length to prevent the user
from crashing your software.

Certain parts of PTC's software have never changed since it came out on UNIX systems decades ago. Unix does not allow spaces in file names so PTC does not. Obviously since PTC no longer supports any version of Unix or Linix, they could rewrite that portion of the code but it works "good enough" as is so they don't bother. I think it is the same with the file name lengths. They have always had a 32 character limit, I think it is self imposed since the versions of Unix I used did not have that limit. Heck, remember DOS? File names were restricted to 8.3 characters. At least Mr. Bill saw the error of his ways and improved that.

In Reply to Scott Rockwell:


Did you ever wonder why ... ?
Whenever I create a PDF file from a drawing file with the PTC maximum file name length and I want to increase the length by adding "-rev_X" Creo always disallows it with an error message "Invalid Name. Filename is too long".
Why should Creo care at this point? I'm wanting to export to PDF format. Print to file will cause the same error.


[Quantum]

Scott Rockwell hardware engineering
720.249.5752 | Scott.Rockwell@Quantum.com< | Quantum.comhttp://www.quantum.com

[Quantum.com]<

Showing how difficult it is to keep the software conforming to 'conventions':

Another coding annoyance (possibly a leftover from *NIX systems) I run into in PTC/CREO as long as I have used it is is the difference in key presses (particularly the spacebar) in the parameters definition dialog in part/assembly mode vs. parameter editing in drawing mode:

When creating a text parameter in the dialog, you may inadvertently hold down the shift key as you type in a string of uppercase characters including a space. Doing this changes the space (ASC32) to (ASC255) When you do this the space is considered a 'hard space' (maybe ?) and the entire line is highlighted. Maybe this is really an MS Windows thing?

If you have a table on a drawing that shows the text from a parameter, you can edit this parameter text in-context. The shift-spacebar key press acts as you would expect and creates a normal space character. This is also how most (all) text entry fields accept the shift-space as well.

While you could just say 'Don't hold the spacebar down when typing a space in a series of uppercase characters', it is annoying.

Small problem, I know, but like an itch that is impossible to scratch. Inconsistencies....

Christopher F. Gosnell

FPD Company
124 Hidden Valley Road
McMurray, PA 15317

The PDF name (or any export name) is limited by the definition of the filename size. It is 32 characters.

As far as I know Creo itself is constrained to the same limits as set in the Toolkit API
See the file name size definition below. Also in case you ever wondered it appears 25 is the maximum level of sub assemblies.

#define PRO_LINE_SIZE 81
#define PRO_PATH_SIZE 260
#define PRO_COMMENT_SIZE 256
#define PRO_VALUE_SIZE 256

#define PRO_NAME_SIZE 32 /* Any Creo Elements/Pro name */
#define PRO_TYPE_SIZE 4 /* "prt", "asm", "drw", etc. */
#define PRO_EXTENSION_SIZE 4 /* size 3; plus NULL terminator */
#define PRO_VERSION_SIZE 4
#define PRO_MAX_ASSEM_LEVEL 25
#define PRO_FEATREF_KEY_SIZE 81

/* name.ext.# */
#define PRO_FILE_NAME_SIZE (PRO_NAME_SIZE + \
PRO_EXTENSION_SIZE + \
PRO_VERSION_SIZE)


Mark Steffke


This was the official response I received (10/2014, sorry for the delay) from PTC as a result of my original posting.  To Mathew, I say thank you.  This is the first time in 20 years I've seen PTC react directly to user inputs in a timely manner.  My hats off to you!

A good day to you all,

I saw the discussion "[proecad] - RE: Why does Creo 2.0 care how long the file name is when creating a PDF" on the exploder, and followed up internally, as there didn't seem to be an SPR on the issue.

In ancient times, Creo (then Pro/ENGINEER) had a limit of 31 characters on file names.  Over time, we found we wanted to support various external types which should not have this limit, and so the large table (some 450 entries) of known file types had a field for the maximum length.  Types that naturally should not be limited beyond the maximal length of full paths (such as .csv, .igs/.iges, .set, .dxf, etc.) had their entries updated to remove the limitation, and code that dealt with these names checked to ensure we weren't using a too-small fixed buffer to store the name.  This process is as we notice them, either internally or from a customer filing an SPR.

To date, .pdf had not been updated, until the exploder discussion brought it to my attention. Fortunately, the person in charge of .pdf export was able to quickly confirm that it would be safe to remove the length limitation on our understanding of the .pdf file type, so I've made an internal SPR and prepared this change.  Pending testing results coming back okay, you should see it in Creo 2 M140 and Creo 3 M020.

If you see any similar cases in future, of external-to-PTC file types for which Creo has an unreasonable name length restriction, please do not hesitate to report it to Support, so we can improve the software.

Yours,

Matthew Ender

VP of Technology

PTC

Top Tags