- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings all,
Pardon my English and knowledge as I know nothing about lisp nor coding in AutoCAD.
I just found a lisp routine somewhere on the net, to draw a Wall combo (wall complete with plastering and hatching) from one point to another point, which I really interested with and found it very useful for my daily work use. Credits to whoever created this lisp 🙂
The lisp routine as below:
WALL(defun c:wall (/ pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 len ang angt)
(setvar "cmdecho" 0)
(command "undo" "be")
(initget 1)
(setq pt1 (getpoint "\nChoose the wall starting point: "))
(initget 1)
(setq pt2 (getpoint pt1 "\nDetermine the wall length: "))
(setq lama (getvar "osmode"))
(setvar "osmode" 0)
(setq ang (angle pt1 pt2))
(setq len (distance pt1 pt2))
(setq angt (angtos ang 4 4))
(if (<= (* pi 25) ang)(setq angt (angtos (- ang (/ pi 2)) 4 4)))
(setq pt3 (polar pt2 (+ (/ pi 2) ang) 150))
(setq pt4 (polar pt3 (+ pi ang) len))
(setq pt5 (polar pt1 (+ (/ pi 2) ang) 20))
(setq pt6 (polar pt5 ang len))
(setq pt7 (polar pt6 (+ (/ pi 2) ang) 110))
(setq pt8 (polar pt7 (+ pi ang) len))
(command "PLINE" pt1 pt2 pt3 pt4 "C")
(command "PLINE" pt5 pt6 pt7 pt8 "C")
(command "-HATCH" "P" "ansi37" "10" "0" "A" "A" "Y" "" "S" "last" "" "")
(setvar "osmode" lama)
(command "undo" "e")
)
I wonder if anyone can help me to refine the lisp, so the outcome will be as exacts as I expected. The original lisp routine will draw a wall combo with very basic properties as all lines and hatching will be assigned to Layer '0'.
I need the wall combo to have the option to specify wall thickness upon creation. Also each lines and hatching will be assigned with a specific layers and color automatically (kindly refer the screenshot below for further understanding).
Any help would be highly appreciated from the bottom of my heart. Many thanks in advance.
Solved! Go to Solution.