Hi friends ,in this article i will explain about how to give
the hatch to the circle in autolisp.
First of all open the Visual Lisp Editor in autocad
Open AutoCAD --- click on Tools --- click on AutoLISP----click on Visual LISP Editor .
After
open the Visual LISP Editor write the following code .
(defun c:col_cir()
(command "setvar" "cmdecho"
"0")
(command "blipmode" "off")
(command "layer" "n" "hatch"
"c" "magenta" "hatch" "")
(command "layer" "n"
"column" "c" "red" "column"
"s" "column" "")
(setq p1 (getpoint "\nPick center point"))
(setq dia (getstring "\nEnter the dia of column
in:"))
(command "circle" p1 "d" dia)
(command
"layer" "s" "hatch" "")
(if (> (distof dia) 100)
(command
"hatch" "net" "10" "45" "l"
"")
(command
"hatch" "net" "0.5" "45"
"l" "")
)
)
|
Save the file as col_cir.LSP
Goto In
the c:col_cir() c shows the main function in this file.
Goto AutoCAD.in the
command prompt write the following.
Command: (load “col_cir”)
|
Press ENTER.
This shows that load the col_cir.LSP
file.
Type col_cir and
press ENTER the output like the below figure.
No comments:
Post a Comment