Show your code you have so far,
also can you create block manually?
If so then post your block as drawing to make more sense for me
Here is quick code just on Lisp, copy to notepad and
save as .lsp file, and spell all prompts in the code,
I didn't know how to write them all correct:
Code:
(defun C:demo (/ D FIRST H L N NEXT P1 PL1 PL2 PLEFT PR1 PR2 S SO SSET STUD THK W)
(if (tblsearch "block" "SR01");<~~ block name
(alert "Already exists")
(progn
;; all sizes from your pdf file for the first item (default input)
(setq N 8;(getint "\n Number of studs: ")
D 0.5;(getreal "\nDiameter of stud: ")
So 2.5;(getreal "\nEdge size: ")
S 3.0;(getreal "\nEqual space between studs: ")
H 6.5;(getreal "\nHeight of stud: ")
W 1.25;(getreal "\nWidth of stud: ")
Thk 0.25;(getreal "\nThikness of stud: ")
L (+ (* 2 So)(* (1- N) S)))
(setq sset (ssadd))
(setq pleft (getpoint "\nLower left point: "))
(command "_rectangle" "_non" pleft "_non" (mapcar '+ pleft (list L Thk)))
(setq first (entlast))
(ssadd first sset)
(setq p1 (list (+ (car pleft) So)(+ (cadr pleft) Thk) 0))
(setq pL1 (mapcar '- p1 (list (/ D 2) 0 0))
pR1 (mapcar '+ p1 (list (/ D 2) 0 0))
pL2 (mapcar '+ pL1 (list 0 (- H Thk) 0))
pR2 (mapcar '+ pR1 (list 0 (- H Thk) 0)))
(command "_pline" "_non" pL1 "_non" pL2 "_non" pR2 "_non" pR1 "_cl")
(setq stud (entlast))
(command "_-array" stud "" "R" 1 N S)
(while (setq next (entnext first))
(ssadd next sset)
(setq first next))
(command "-block" "SR01" pleft sset "")
)
)
(princ)
)
(princ "\n\t---\tType DEMO to execute \t---")
(prin1)