Jump to content

Creating SHX/SHP file and mapping shapes to keys


Recommended Posts

I have looked all over the place trying to figure out how to create a SHX file to use in AutoCAD that has each shape in the file mapped to a key and I am not having any luck. Perhaps someone here will know how to do this. I apologize if this has been covered somewhere already. If that is the case, please just link me to where this is explained.

 

I know how to create a shape file using MKSHAPE. I know how to convert the SHP file to a SHX file using CONVERT. I know that SHX files have to be in a FONT folder within the AutoCAD folder. But none of this explains how to create a SHX file that I can use in the MTEXT command for example so that when I type the letter A (for example) the custom shape I created for the letter A is displayed, and the same for B and so on.

 

Is there a program I need to use to help me create such a file? If not, what is the process I would have to go thru manually to create what I need?

Link to comment
Share on other sites

I would start by taking an existing text file, for example txt.shx, and using Express Tools DUMPSHX (which is used on the OS command line) to convert the complied file to the equivalent SHP (decompiled) file.

 

Then you could look at this file with an ordinary text editor (Wordpad or Notepad) and see if you can make any sense of what you see. You may gain enough knowledge to try making your own text file with shapes instead of conventional characters. Be warned that if you intend to share this drawing, you would have to send this text file with the drawing otherwise the alternative font file would be used.

Link to comment
Share on other sites

An alternative I do not know how but I am sure is much easier now days, is to make a true type font, the nice thing is it will work in Autocad, word excel anything basically. 

 

I used to use a sign true type font you type A and a stop sign appears. It had 7 fonts with around 80 symbols A-Z,a-z,0-9 etc per font.

 

Did a bit of googling and fontforge looked interesting, disclaimer  I have no idea how good it works.

 

image.thumb.png.2f76a4f1510354aada5b507b94e16cc7.png

Link to comment
Share on other sites

On 9/4/2019 at 10:31 PM, abraxus said:

I have looked all over the place trying to figure out how to create a SHX file to use in AutoCAD that has each shape in the file mapped to a key and I am not having any luck.

 

 

Have you seen this?

 

It explains how to tag the SHP file so that AutoCAD knows it's a font file and not a shape file, and that each character definition must be coded using the ASCII code for the desired character. For example, "65" is an upper case "A"

 

*65,11,uca
024,043,04d,02c,2,047,1,040,2,02e,0
Link to comment
Share on other sites

I still think going to ttf may be be better as the font convert uses vector input which Autocad basically is. Like every one need time to play.

 

Any way a handy hint (ascii (getstring "enter character")) type a 97 revealed. type this command line (ascii (getstring)) I use copy and paste so can repeat

Link to comment
Share on other sites

*97,11,lca

024,043,04d,02c,2,047,1,040,2,02e,0

use character "a" it has 11 items its name is known as lca

 

*65,56,ARROW
4,250,4,4,3,29,3,55,3,243,002,9,(8,5),(0,0),001,9,(108,0),(-43,43),(15,0),(48,-48),(-48,-48),(-15,0),(43,43),(-108,0)
(0,10),(0,0),002,9,(-8,-5),(0,0),001,4,243,4,55,4,29,3,4,3,250,0

 

Just add more items

 

*66,6,BOX
014,020,02C,028,014,0

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...