How to create the thread forming in hexagon bolt and nut by using solidworks software
Solidworks has a toolbox add on which had most fasteners. You should be able to find one premade in there to suit your needs as it has most standard metric and imperial sizings available.
However to create the threat yourself on the bolt you use the 'wizard hole' from there you can add the thread feature. The feature is often called a 'cosmetic thread'. It has a range of sizes to assist you with getting the thread you need. The same thing can be done for the interact thread of your bolt.
Or you can use the Helix tool to also draw a thread.
Good luck. :)