587,481 active members*
2,882 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 26
  1. #1
    Join Date
    Dec 2004
    Posts
    150

    Drilling Bolt Hole Patterns

    Recently i have been toying and learning a bit of HTML and SCRIPTING. I have found this quite useful for making little helpful utilities. Here is the code for a little web based program that uses user input to calculate 'X' and 'Y' coordinates for hole centres.Copy it to an editor such as notepad and save the file with the extension .html then try it out. I am not an expert on browsers so i couldnt tell you if this works on any others than IE that i use.
    Any feedback or comments would be great, hope this proves useful to someone.


    <html>
    <head>
    <!-- Program for calculating 'X' and 'Y' coordinates values
    from angular information. For example drill hole centers-->

    <title>Bolt Circle Calculator</title>
    <script language=vbscript>
    option explicit
    sub calc_onclick
    dim vholes,vstart,vend,vpitch,vstart2,vpcr,vx,vy
    vstart=document.frm1.start.value
    vend=document.frm1.end.value
    vpcr=document.frm1.pcr.value
    vholes=document.frm1.holes.value
    'error handling msgs
    if (vend+0)<=(vstart+0) then
    msgbox("End Angle Must Be Greater Than Start Angle")
    exit sub
    end if
    if (vholes+0)<1.0 then
    msgbox("Number Of Holes Must Be Greater Than Zero")
    exit sub
    end if
    if (vpcr+0)<1.0 then
    msgbox("Pitch Circle Radius Must Be Greater Than Zero")
    exit sub
    end if
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)
    vpitch=formatnumber(vpitch,4)
    vstart2=vstart

    document.write("<html><head><title>Bolt Results</title></head>")
    document.write("<body bgcolor=gray>")
    document.write("<h1>Bolt Circle Results</h1>")
    document.write("<table border=double bgcolor=#6464ff><tr><th colspan=2>You Entered:</th></tr>")
    document.write("<tr><td align=right>Start Angle </td><td bgcolor=white>= "&vstart&"</td></tr>")
    document.write("<tr><td align=right>End Angle </td><td bgcolor=white>= "&vend& "</td></tr>")
    document.write("<tr><td align=right>PCR </td><td bgcolor=white>= "&vpcr& "</td></tr>")
    document.write("<tr><td align=right>Number Of Holes </td><td bgcolor=white>= "&vholes&"</td></tr>")
    document.write("<tr><td align=right>Calculated Pitch</td><td bgcolor=white>= "&vpitch&"</td></tr>")
    document.write("</table>")
    document.write("<strong>These Are The X&Y Coordinates<br>")
    document.write("You can cut and paste from here</strong><br>")
    document.write("<textarea cols=25 rows=18>")

    do
    vx=vstart2*3.14159265
    vx=vx/180
    vx=cos(vx)*vpcr
    vx=formatnumber(vx,3)
    vy=vstart2*3.14159265
    vy=vy/180
    vy=sin(vy)*vpcr
    vy=formatnumber(vy,3)
    document.write("X"&vx&" "&"Y"&vy&vbcrlf)
    vstart2=(vstart2+0)+(vpitch+0)
    vholes=(vholes+0)-1.0
    loop until (vholes+0)<1.0
    document.write("</textarea>")
    document.write("</body></html>")
    end sub
    </script>
    </head>
    <body bgcolor="gray">
    <form name="frm1">
    <table border=double bgcolor=#6464ff>
    <tr><th colspan="2" align="center"><h1>Bolt Circle Calculator</h1></th></tr>
    <tr><th>Start Angle?</th><td><input type="text" name="start" value="0"></td></tr>
    <tr><th>End Angle?</th><td><input type="text" name="end" value="180"></td></tr>
    <tr><th>Pitch Circle Radius?</th><td><input type="text" name="pcr" value="100"></td></tr>
    <tr><th>Number of holes?</th><td><input type="text" name="holes" value="19"></td></tr>
    <tr><td colspan="2" align="center"><input type="button" name="calc" value="Calculate"></td></tr>
    </table>
    <form>
    </body>
    </html>

  2. #2
    Join Date
    Mar 2004
    Posts
    847
    Nice. A 'RESET' button would be a nice addition.
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
    Check Out My Build-Log: http://www.cnczone.com/forums/showthread.php?t=6452

  3. #3
    Join Date
    Feb 2005
    Posts
    78
    G'day
    How do you use the file TURNER?

  4. #4
    Join Date
    Feb 2005
    Posts
    78

    Smile

    Quote Originally Posted by oldjohn
    G'day
    How do you use the file TURNER?
    Got it. Thanks for the file.
    John

  5. #5
    Join Date
    Dec 2004
    Posts
    150

    Modified Bolt circle calculator

    Quote Originally Posted by JavaDog
    Nice. A 'RESET' button would be a nice addition.
    Here's a new version works all on one page, see what you think...

    Again copy and paste all code below into notepad and save with extension .html



    <html>
    <head>
    <!-- Program for calculating 'X' and 'Y' coordinates values
    from angular information. For example drill hole centers

    Save this file from a text editor for example notepad.exe
    with a file extension .html for example ' bolt.html '

    Note this program was intended for ms internet explorer and
    runs using vbscript language. Do not know what will happen if
    using other Browsers.
    -->

    <title>Bolt Circle Calculator</title>
    <script language=vbscript>
    option explicit
    dim vholes,vstart,vend,vpitch,vstart2,vpcr,vx,vy,vtxt1
    vtxt1=""


    '''''''''''''''''''''''''''''
    ' CALCULATE BUTTON CLICKED= '
    '''''''''''''''''''''''''''''
    sub calc1_onclick
    vstart=document.frm1.start.value
    vend=document.frm1.end.value
    vpcr=document.frm1.pcr.value
    vholes=document.frm1.holes.value
    document.frm1.txt1.value=vtxt1&vbcrlf
    'error handling msgs
    if (vend+0)<=(vstart+0) then
    msgbox("End Angle Must Be Greater Than Start Angle")
    exit sub
    end if
    if (vholes+0)<2 then
    msgbox("Number Of Holes Must Be Greater Than One")
    exit sub
    end if
    if (vpcr+0)<1.0 then
    msgbox("Pitch Circle Radius Must Be Greater Than Zero")
    exit sub
    end if
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)
    vpitch=formatnumber(vpitch,4)
    vstart2=vstart
    document.frm1.pitch.value=vpitch
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes from "&vbcrlf&vstart&" to "&vend&" degrees"&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&vbcrlf)
    do
    vx=vstart2*3.14159265
    vx=vx/180
    vx=cos(vx)*vpcr
    vx=formatnumber(vx,3)
    vy=vstart2*3.14159265
    vy=vy/180
    vy=sin(vy)*vpcr
    vy=formatnumber(vy,3)
    vtxt1=document.frm1.txt1.value
    document.frm1.txt1.value=vtxt1+("X"&vx&" "&"Y"&vy&vbcrlf)
    vstart2=(vstart2+0)+(vpitch+0)
    vholes=(vholes+0)-1.0
    loop until (vholes+0)<1.0
    end sub
    '''''''''''''''''''''''''
    ' RESET BUTTON CLICKED= '
    '''''''''''''''''''''''''
    sub reset_onclick
    document.frm1.start.value="0"
    document.frm1.end.value="0"
    document.frm1.pcr.value="0"
    document.frm1.holes.value="0"
    document.frm1.pitch.value="leave this"
    document.frm1.txt1.value="Your results will be shown here..."
    vtxt1=document.frm1.txt1.value
    document.frm1.txt1.value=vtxt1&vbcrlf
    vtxt1=""
    end sub
    </script>


    </head>
    <body bgcolor="gray">
    <form name="frm1">
    <table border="double" bgcolor="#6464ff">
    <tr>
    <td>
    <table>
    <tr><th colspan="2" align="center"><h1>Bolt Circle Calculator</h1></th></tr>
    <tr><th>Start Angle?</th><td><input type="text" name="start" value="0"></td></tr>
    <tr><th>End Angle?</th><td><input type="text" name="end" value="180"></td></tr>
    <tr><th>Pitch Circle Radius?</th><td><input type="text" name="pcr" value="100"></td></tr>
    <tr><th>Number of holes?</th><td><input type="text" name="holes" value="19"></td></tr>

    <tr><th style="color:#804040">Calculated Pitch=</th><td><input type="text" name="pitch" value="leave this"></td></tr>
    <tr><td align="center"><input style="" type="button" name="calc1" value="Calculate"></td>
    <td align="center"><input type="button" name="reset" value="Reset"></td></tr>
    </table>
    </td>
    <td rowspan=2>
    <textarea cols=30 rows=32 name="txt1">Your results will be shown here...
    </textarea>
    </td>
    </tr>
    <tr border="0"><td border="0"><h3>Instructions.</h3><strong>
    Fill in the input boxes above and then click CALCULATE
    Your results will appear in the text area to the right,
    where you will be able to use your mouse to select text
    and cut, to paste into your program.<br><br>

    By entering new data into the input boxes, and clicking
    CALCULATE again, you will add more code to the end of the
    existing code.<br><br>

    By pressing RESET all the boxes will be cleared for a fresh
    start
    </strong><br></td></tr>
    </table>



    <form>
    </body>
    </html>

  6. #6
    Join Date
    Jan 2005
    Posts
    52
    Cool! But I got strange results with inputs: 0,360,100,4

    So I changed this line:
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)

    To this:
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-0.0)

    And then got what I think are good results. Somebody check my math.

    CP

  7. #7
    Join Date
    Dec 2004
    Posts
    150
    Quote Originally Posted by cp8071
    Cool! But I got strange results with inputs: 0,360,100,4

    So I changed this line:
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)

    To this:
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-0.0)

    And then got what I think are good results. Somebody check my math.

    CP
    Hi cp,
    Good Point..
    I think to get the results you were after, your entry that was
    inputs: 0,360,100,4 should have been: 0,270,100,4 this is because
    the "End Angle" is actually the angle of your last hole. Lets say you
    wanted to have a start hole at 0 and an end hole at 90 with one
    in the middle, your entry woulld be:0,90,100,3..calc pitch=45.000
    maybe a little confusion with instructions needs modifying.
    If you use it in a different way maybe i could add other options?

    Turner.

  8. #8
    Join Date
    Jan 2005
    Posts
    52
    Ok, I see my mistake as trying to use it to do bolt circles with the input data: 0-360 degrees every time. If I want the first hole to be top-right then I have to start at 45 and end at 315 (for a 4 bolt pattern.)

    I think it would be useful to have a collection of calculators for generating these patterns when you have different input information.

    Less than a full circle (specify start/end angles)
    Full circle (only radius and hole # inputs)
    Pattern where I have distance between and number of holes only

    CP

  9. #9
    Join Date
    Dec 2004
    Posts
    150

    In Reply To CP On Bolt Patterns

    Quote Originally Posted by cp8071
    Ok, I see my mistake as trying to use it to do bolt circles with the input data: 0-360 degrees every time. If I want the first hole to be top-right then I have to start at 45 and end at 315 (for a 4 bolt pattern.)

    I think it would be useful to have a collection of calculators for generating these patterns when you have different input information.

    Less than a full circle (specify start/end angles)
    Full circle (only radius and hole # inputs)
    Pattern where I have distance between and number of holes only

    CP

    I was thinking the same thing, i've modified the program again so it works slightly different depending on how you fill in the Data. Instructions have also been updated to try and make clear how it works.
    Turner.

    New Source Code
    --------------------------


    <html>
    <head>
    <!-- Program for calculating 'X' and 'Y' coordinates values
    from angular information. For example drill hole centers

    Save this file from a text editor for example notepad.exe
    with a file extension .html for example ' bolt.html '

    Note this program was intended for ms internet explorer and
    runs using vbscript language. Do not know what will happen if
    using other Browsers.
    -->

    <title>Bolt Circle Calculator</title>
    <script language=vbscript>
    option explicit
    dim vholes,vstart,vend,vpitch,vstart2,vpcr,vx,vy,vtxt1
    vtxt1=""


    '''''''''''''''''''''''''''''
    ' CALCULATE BUTTON CLICKED= '
    '''''''''''''''''''''''''''''
    sub calc1_onclick
    vstart=document.frm1.start.value
    vend=document.frm1.end.value
    vpcr=document.frm1.pcr.value
    vholes=document.frm1.holes.value
    document.frm1.txt1.value=vtxt1&vbcrlf
    'error handling msgs
    if (vend+0)<=(vstart+0) then
    msgbox("End Angle Must Be Greater Than Start Angle")
    exit sub
    end if
    if (vholes+0)<2 then
    msgbox("Number Of Holes Must Be Greater Than One")
    exit sub
    end if
    if (vpcr+0)<1.0 then
    msgbox("Pitch Circle Radius Must Be Greater Than Zero")
    exit sub
    end if
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)
    if vstart=0 then
    if vend=360 then
    vpitch=360/vholes
    end if
    end if
    vpitch=formatnumber(vpitch,4)
    vstart2=vstart
    document.frm1.pitch.value=vpitch
    if vstart=0 then
    if vend=360 then
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes equispaced "&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&vbcrlf)
    else
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes from "&vbcrlf&vstart&" to "&vend&" degrees"&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&vbcrlf)
    end if
    else
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes from "&vbcrlf&vstart&" to "&vend&" degrees"&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&vbcrlf)
    end if

    vtxt1=document.frm1.txt1.value
    do
    vx=vstart2*3.14159265
    vx=vx/180
    vx=cos(vx)*vpcr
    vx=formatnumber(vx,3)
    vy=vstart2*3.14159265
    vy=vy/180
    vy=sin(vy)*vpcr
    vy=formatnumber(vy,3)
    document.frm1.txt1.value=vtxt1+("X"&vx&" "&"Y"&vy&vbcrlf)
    vtxt1=document.frm1.txt1.value
    vstart2=(vstart2+0)+(vpitch+0)
    vholes=(vholes+0)-1.0
    loop until (vholes+0)<1.0
    end sub
    '''''''''''''''''''''''''
    ' RESET BUTTON CLICKED= '
    '''''''''''''''''''''''''
    sub reset_onclick
    document.frm1.start.value="0"
    document.frm1.end.value="0"
    document.frm1.pcr.value="0"
    document.frm1.holes.value="0"
    document.frm1.pitch.value="leave this"
    document.frm1.txt1.value="Your results will be shown here..."
    vtxt1=document.frm1.txt1.value
    document.frm1.txt1.value=vtxt1&vbcrlf
    vtxt1=""
    end sub
    </script>


    </head>
    <body bgcolor="gray">
    <form name="frm1">
    <table border="double" bgcolor="#6464ff">
    <tr>
    <td>
    <table>
    <tr><th colspan="2" align="center"><h1>Bolt Circle Calculator</h1></th></tr>
    <tr><th>Start Angle?</th><td><input type="text" name="start" value="0"></td></tr>
    <tr><th>End Angle?</th><td><input type="text" name="end" value="180"></td></tr>
    <tr><th>Pitch Circle Radius?</th><td><input type="text" name="pcr" value="100"></td></tr>
    <tr><th>Number of holes?</th><td><input type="text" name="holes" value="19"></td></tr>

    <tr><th style="color:#804040">Calculated Pitch=</th><td><input type="text" name="pitch" value="leave this"></td></tr>
    <tr><td align="center"><input style="" type="button" name="calc1" value="Calculate"></td>
    <td align="center"><input type="button" name="reset" value="Reset"></td></tr>
    </table>
    </td>
    <td rowspan=2>
    <textarea cols=30 rows=36 name="txt1">Your results will be shown here...
    </textarea>
    </td>
    </tr>
    <tr border="0"><td border="0"><h3>Instructions.</h3><strong>
    Fill in the input boxes above and then click CALCULATE.
    Your results will appear in the text area to the right,
    where you will be able to use your mouse to select text
    and cut, to paste into your program.<br><br>

    By entering new data into the input boxes, and clicking
    CALCULATE again, you will add more code to the end of the
    existing code.<br><br>

    By pressing RESET all the boxes will be cleared for a fresh
    start.<br><br>

    START ANGLE=first hole and END ANGLE=last hole.<br>
    If you enter START ANGLE=0 and END ANGLE=360 then
    program will calculate equispaced holes.<br>
    Note! First hole is at 3 o'clock, and holes travel anti-clockwise.
    </strong><br></td></tr>
    </table>



    <form>
    </body>
    </html>

  10. #10
    Join Date
    Feb 2005
    Posts
    78
    Quote Originally Posted by TURNER
    Hi cp,

    If you use it in a different way maybe i could add other options?

    Turner.
    G'day TURNER
    Would it be too much to ask if you could add an option for Centre of Circle coordinates?
    If not it's still ok for me.
    Regards
    John

  11. #11
    Join Date
    Dec 2004
    Posts
    150
    Quote Originally Posted by oldjohn
    G'day TURNER
    Would it be too much to ask if you could add an option for Centre of Circle coordinates?
    If not it's still ok for me.
    Regards
    John
    Hi John,
    Please explain further, Sorry don't understand what your asking for??
    Turner.

  12. #12
    Join Date
    Feb 2005
    Posts
    78
    Hi TURNER
    What I mean is the X,Y coordinates of the bolt hole circle. As if I wanted to drill two hole circles in two different locations. see attached file.
    Thank you
    John
    I think it was the wrong format. here it goes again.
    Attached Thumbnails Attached Thumbnails bolt-hole-circle.jpg  

  13. #13
    Join Date
    Dec 2004
    Posts
    150

    Wink New src code with option Shift Origin

    Hi John,
    Good idea!
    Heres the new html src code, copy it and overwrite your original file.
    Please let me know how it goes.

    src code.......


    <html>
    <head>
    <!-- Program for calculating 'X' and 'Y' coordinates values
    from angular information. For example drill hole centers

    Save this file from a text editor for example notepad.exe
    with a file extension .html for example ' bolt.html '

    Note this program was intended for ms internet explorer and
    runs using vbscript language. Do not know what will happen if
    using other Browsers.
    -->
    <title>Bolt Circle Calculator</title>
    <style type="text/css">
    body
    {background-color:#407288;}
    table
    {border-style:none;background-color:#407288;}
    .buttons
    {background-color:#48bb48;width:"100%"}
    </style>
    <script language="vbscript">
    option explicit
    dim vholes,vstart,vend,vpitch,vstart2,vpcr,vx,vy,vtxt1
    dim xcent,ycent
    vtxt1=""
    '''''''''''''''''''''''''''''
    ' CALCULATE BUTTON CLICKED= '
    '''''''''''''''''''''''''''''
    sub calc1_onclick
    vstart=document.frm1.start.value
    vend=document.frm1.end.value
    vpcr=document.frm1.pcr.value
    vholes=document.frm1.holes.value
    xcent=document.frm1.xcent.value
    ycent=document.frm1.ycent.value
    xcent=formatnumber(xcent,3)
    ycent=formatnumber(ycent,3)
    document.frm1.txt1.value=vtxt1&vbcrlf
    'error handling msgs
    if (vend+0)<=(vstart+0) then
    msgbox("End Angle Must Be Greater Than Start Angle")
    exit sub
    end if
    if (vholes+0)<2 then
    msgbox("Number Of Holes Must Be Greater Than One")
    exit sub
    end if
    if (vpcr+0)<1.0 then
    msgbox("Pitch Circle Radius Must Be Greater Than Zero")
    exit sub
    end if
    vpitch=((vend+0)-(vstart+0))/((vholes+0)-1.0)
    if vstart=0 then
    if vend=360 then
    vpitch=360/vholes
    end if
    end if
    vpitch=formatnumber(vpitch,3)
    vstart2=vstart
    document.frm1.pitch.value=vpitch
    if vstart=0 then
    if vend=360 then
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes equispaced "&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&"Origin=X"&xcent&" Y"&ycent&vbcrlf&vbcrlf)
    else
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes from "&vbcrlf&vstart&" to "&vend&" degrees"&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&"Origin=X"&xcent&" Y"&ycent&vbcrlf&vbcrlf)
    end if
    else
    document.frm1.txt1.value=vtxt1+(vbcrlf&vholes&" holes from "&vbcrlf&vstart&" to "&vend&" degrees"&vbcrlf&"at "&vpitch&" degrees pitch"&vbcrlf&"on a "&vpcr&" pcr"&vbcrlf&"Origin=X"&xcent&" Y"&ycent&vbcrlf&vbcrlf)
    end if
    vtxt1=document.frm1.txt1.value
    do
    vx=vstart2*3.14159265
    vx=vx/180
    vx=cos(vx)*vpcr
    vx=vx+xcent
    vx=formatnumber(vx,3)
    vy=vstart2*3.14159265
    vy=vy/180
    vy=sin(vy)*vpcr
    vy=vy+ycent
    vy=formatnumber(vy,3)
    document.frm1.txt1.value=vtxt1+("X"&vx&" "&"Y"&vy&vbcrlf)
    vtxt1=document.frm1.txt1.value
    vstart2=(vstart2+0)+(vpitch+0)
    vholes=(vholes+0)-1.0
    loop until (vholes+0)<1.0
    end sub
    '''''''''''''''''''''''''
    ' RESET BUTTON CLICKED= '
    '''''''''''''''''''''''''
    sub reset_onclick
    document.frm1.start.value="0"
    document.frm1.end.value="0"
    document.frm1.pcr.value="0"
    document.frm1.holes.value="0"
    document.frm1.pitch.value="leave this"
    document.frm1.txt1.value="Your results will be shown here..."
    vtxt1=document.frm1.txt1.value
    document.frm1.txt1.value=vtxt1&vbcrlf
    vtxt1=""
    end sub
    ''''''''''''''''''''''''''''''''
    ' INSTRUCTIONS BUTTON CLICKED= '
    ''''''''''''''''''''''''''''''''
    sub instruct_onclick
    vtxt1=""
    vtxt1=vtxt1+"INSTRUCTIONS."&vbcrlf
    vtxt1=vtxt1+"Fill in the input boxes above and then click CALCULATE. "&vbcrlf
    vtxt1=vtxt1+"Your results will appear in the text area HERE!!, "
    vtxt1=vtxt1+"where you will be able to use your mouse to select text "
    vtxt1=vtxt1+"and cut, to paste into your program."&vbcrlf&vbcrlf

    vtxt1=vtxt1+"By entering new data into the input boxes, and clicking "
    vtxt1=vtxt1+"CALCULATE again, you will add more code to the end of the "
    vtxt1=vtxt1+"existing code."&vbcrlf&vbcrlf

    vtxt1=vtxt1+"By pressing RESET all the boxes will be cleared for a fresh "
    vtxt1=vtxt1+"start."&vbcrlf&vbcrlf

    vtxt1=vtxt1+"START ANGLE=first hole and"&VBCRLF&"END ANGLE=last hole."&vbcrlf
    vtxt1=vtxt1+"If you enter START ANGLE=0 and END ANGLE=360 then the "
    vtxt1=vtxt1+"program will calculate equispaced holes. "
    vtxt1=vtxt1+"Note! First hole is at 3 o'clock, and holes travel anti-clockwise. "&vbcrlf&vbcrlf
    vtxt1=vtxt1+"By entering values in 'Shift Origin X & Y ', You could replicate multiple/offset patterns."&vbcrlf&vbcrlf&vbcrlf
    document.frm1.txt1.value=vtxt1
    vtxt1=""
    end sub
    </script>
    </head>
    <body>
    <form name="frm1">
    <table>
    <tr>
    <td>
    <table>
    <tr><th colspan="2" align="center"><h1>Bolt Circle Calculator</h1></th></tr>
    <tr><th>Start Angle?</th><td><input type="text" name="start" value="0"></td></tr>
    <tr><th>End Angle?</th><td><input type="text" name="end" value="180"></td></tr>
    <tr><th>Pitch Circle Radius?</th><td><input type="text" name="pcr" value="100"></td></tr>
    <tr><th>Number of holes?</th><td><input type="text" name="holes" value="10"></td></tr>
    <tr><th style="color:#804040">Calculated Pitch=</th><td><input type="text" name="pitch" value="leave this"></td></tr>
    <tr><th colspan="2">Shift Origin, Centre Of Pcr</th></tr>
    <tr><td align="center"><strong>'X'=</strong><input type="text" name="xcent" value="0" size="10"></td><td align="center"><strong>'Y'=</strong><input type="text" name="ycent" value="0" size="10"></td></tr>
    <tr><td align="center"><input style="" type="button" name="calc1" value="Calculate" class="buttons"></td></tr>
    <tr><td align="center"><input type="button" name="reset" value="** Reset **" class="buttons"></td></tr>
    <tr><td colspan="2" align="center"><input type="button" name="instruct" value="? Show Instructions ?" class="buttons"></td></tr>
    </table>
    </td>
    <td>
    <textarea cols="45" rows="25" name="txt1" align="top">Your results will be shown here...
    </textarea>
    </td>
    </tr>
    </table>
    <form>
    </body>
    </html>


    Turner

  14. #14
    Join Date
    Feb 2005
    Posts
    78
    Mate, you are a genius. I am impressed. Very good tool for programming.
    Thank you very much.
    John

  15. #15
    Join Date
    Jan 2004
    Posts
    11
    Great program Turner. Found one small bug. If you enter a pitch radius less than 1, it brings up an error dialogue. I corrected the js with following change

    was
    if (vpcr+0)<1.0 then

    changed to
    if (vpcr+1)<1.0 then

    and all works fine.

    Thanks again
    Maynard

  16. #16
    Join Date
    Mar 2005
    Posts
    305
    :cheers: Well done!

  17. #17
    Join Date
    Dec 2004
    Posts
    150
    Quote Originally Posted by mcurtis
    Great program Turner. Found one small bug. If you enter a pitch radius less than 1, it brings up an error dialogue. I corrected the js with following change

    was
    if (vpcr+0)<1.0 then

    changed to
    if (vpcr+1)<1.0 then

    and all works fine.

    Thanks again
    Maynard

    Sorry M.C. my mistake. With working in Metric would never have a pcr below '1', didnt think about imperial sizes, well spotted.

    Cheers,Turner

  18. #18
    Join Date
    Sep 2005
    Posts
    8
    Thank you very much. This will come in very handy. Makes me want to learn more about html.

  19. #19
    Join Date
    Jan 2007
    Posts
    243
    How about using a windows based software calculator? Bolt Circle Calculator
    www.WebMachinist.Net
    The Ultimate Online Source for Machinist Related Stuff!

  20. #20
    Join Date
    Oct 2012
    Posts
    84
    I saved this out and the gui comes up but doesn't calculate after input. What am I doing wrong? I used notepad++ and saved as html and clicked the file and it brought it up.

Page 1 of 2 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •