.PAT file name length limit - 34 characters? (Hatch Pattern files) -AutoCAD 2016

.PAT file name length limit - 34 characters? (Hatch Pattern files) -AutoCAD 2016

Anonymous
Not applicable
1,383 Views
5 Replies
Message 1 of 6

.PAT file name length limit - 34 characters? (Hatch Pattern files) -AutoCAD 2016

Anonymous
Not applicable

Hello,

 

I am in AutoCAD 2016.

 

Recently I have been working a lot with custom hatch patterns which are their own individual [name].pat files. 

 

I am writing this post mostly to confirm something that seems to be true, but I'm not certain.  I was not able to find anything about it on the internet including these forums. 

 

If I create a custom hatch pattern file (.pat file), is it true that the maximum file name length is 34 characters (not including the extension (the .pat))?  That seems to be what I have found.  I did some testing and eventually found that a hatch pattern file whose name was 34 characters did work in AutoCAD, but if I try to use a .PAT file whose name is 35 characters or more, AutoCAD bugs out and then gives me an error message "Error handler re-entered. Exiting now." and automatically exits AutoCAD without saving.

 

Further details: I have HPDLGMODE set to 1.  I haven't checked if the same thing happens with HPDLGMODE set to 2.  (And I just today found out you can set HPDLGMODE to 0, I don't know what that does at all). 

 

Thanks

1,384 Views
5 Replies
Replies (5)
Message 2 of 6

hugha
Collaborator
Collaborator

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Customization...

 

states:

Regardless of where a definition is stored, a custom hatch pattern has the same structure. It has a header line with a name, which begins with an asterisk and is no more than 31 characters long, and an optional description.

 

It's very poorly specified - does the name include the asterisk?  Because a pattern XXXX  is normally stored in a file called XXXX.pat (no asterisk) I would think the safe thing to do is keep a pattern and filename maximum length of 30.  I've not seen 34 mentioned before.

 

Not that the help entry needs be 100% ACCURATE.  Equally safe advice could have nominated any number less than 30 (31?).  The global safe limit may be governed by code constraints elsewhere such as in DXF file handling,  saving to earlier versions ...

 

Please keep up the good work. We need certainty here and I strongly suggest you report the fatal behaviour you discovered.

0 Likes
Message 3 of 6

j.palmeL29YX
Mentor
Mentor

My Help file says:

a custom hatch pattern has ... a header line with a name, which begins with an asterisk and is no more than 31 characters long, and an optional description.

*pattern-name, description

 

and also at other place

"The name of the hatch pattern is limited to 31 characters".

 

Because the name of the file must be the same as the pattern name (without the asterix) the file name lengh also is limited. 

I guess that's from the old days, when the filename couldn't exceed a length of 31 characters.

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 6

Anonymous
Not applicable

Thank you for these helpful replies.  I came up with another question which is somewhat relevant to using hatch patterns in AutoCAD.  At least, it is relevant to my work in AutoCAD, because occasionally at our office, we send our projects out to outside architects and outside architectural consultants, who then do the work, then send us the CAD files back.  Some of these consultants use different CAD programs than AutoCAD. 

 

Perhaps this question is so large (or problematic in some way) that it becomes essentially unanswerable, but I will try it anyway. 

 

If I make sure our custom hatch patterns have a maximum file name length of 29 characters or less*, would this 29 characters still be over the limit for usability in certain other CAD programs?  Would it be better, for example, to apply a 15-character limit to my custom hatch pattern names, rather than a 29-character limit?  (In other words, does anyone have any knowledge of other CAD programs which confirmably do have a hatch pattern file name limit of even less than 29 characters?)

 

I know this is an AutoCAD forum, but if for some reason a consultant gets a hatch that's unusable in their (non-AutoCAD) program, and they change the drawing (or ask us to send them a different hatch), then when I get the drawings back, that does affect the work I do in AutoCAD (if they change the hatch, or explode the hatch, or if I have to make a new hatch, etc.).  So I concluded that this question is still at least marginally relevant to an AutoCAD forum. 

 

I also understand that knowledge about other CAD programs may be limited.  But I appreciate any knowledge if anyone does have answers to my above questions.  Thank you

 

*I have decided to enforce a 29-character limit for my hatch pattern names, only because I am a very careful person and I tend to take a couple extra steps of caution.  In this case, while the help file said that 31 characters is the limit, I decided to remove 2 characters and, for myself, turn it into a 29-character limit, for safety.  (And, even this information contradicts my own "research", which demonstrated that 34 characters is the limit for the file name (not including the .PAT extension). I just choose to take a few extra steps of caution, even if they might be unnecessary). 

0 Likes
Message 5 of 6

hugha
Collaborator
Collaborator

>In other words, does anyone have any knowledge of other CAD programs which confirmably do have a hatch pattern file name limit of even less than 29 characters?

 

From my experience,  no.  Those systems that consume AutoCAD .PAT files either apply the same or relax AutoCAD's restrictions on name length and allowable character set.  

 

Other systems with different formats to specify much the same information (such as DataCAD) require a pattern file  translation where any required renaming will be handled as part of such editing by users more familiar with their system's requirements and some systems can re-export patterns embedded in DXF or DWG assigned verbatim or possibly mangled names.

 

In short, once a pattern leaves your system others will control its naming and content so I see no problem in using any name consistent with AutoCAD.

 

hth,

 

Hugh Adamson

www.hatchkit.com.au

 

0 Likes
Message 6 of 6

JohnHyslop
Enthusiast
Enthusiast

Hi

I have found that the information on the AutoDesk site is contradicting... the limit is 34 characters, this

information should be updated,I've tested and used Hatch Patterns 34 long (not including the .PAT)  

I too dabble a bit with Hatch Patterns and I've set my limit to 34 this is excluding the .PAT extension ..

I also discovered that Draftsight has a limit of 15 .....

If anyone is interested I host my free hatch pattern tool on the qcad forum, it's 100% compatible with

AutoCad... It has 9 basic adjustable patterns to date, I'm looking at adding more basic patterns to future versions..

 

It will always remain free software...

 

Cheers

John Hyslop

0 Likes