Autocad .lsp for making lines

Job ID: 30917468

Budget: $30 – $250 USD

Run the .lsp in Autocad should result in following, numbers is for example:

1) Prompt for clicking on an existing line. (lets say the line runs from P1 to P2 and length is 100)
2) Prompt for gap distance (5)
3) Prompt for prefered segment length (30)
4) Calculate n=(100-5)/30=3,17 and round to integer ~3
5) Calculate line length L=100-5(3+1)/3=26.66667
6) Prompt L and ask for new value for number of segments n or continue with <3> (Here I have the possibility to change number of line from the calculated 3 before proceeding.)
7)Recalculate line length L=100-5(n+1)/n (for in case n is changed by choise above)
8)Replace selected line with lines of length L between P1 och P2 starting at gap distance 5 from P1 and separated with gap distance 5.

Exammple result from P1 to P2; gap 5, line 26.66667, gap 5, line 26.667, gap 5, line 26.667, gap 5 (sum 100)
Related categories: AutoCAD Lisp