Plocky Lisp

(Defun FC (Func N Xo dx)
(
(Setq LP ‘())
(Setq Int (/ dx N)
(Setq x (-Xo Int))
(Repeat (+ N 1)
(Setq x (+x Int))
(Setq y (FuncA x))
(Setq LPP (List x y))
(Setq LP (Cons LPP LP))
)
)
)
(Defun FuncA (V)
(* V V)
)
(Defun DrawF (ListP)
(Setq LPG ListP)
(While ((Lenght LPG) >= 2)
(Setq P1 (Car LPG))
(Setq P2 (Cadr LPG))
(Command “Line” P1 P2)
(Setq LPG (Cdr LPG))
)
)

Similar Posts

  • Legend AutoLisp

    (defun C:LEGEND () (prompt “\nBuilding legend list…\n”) ;Set variable to get the first element of table. (setq Frst T) (setq Counter 0) (setq CountBlk 0) ;Get all block names. (while (setq Tbdata (tblnext “BLOCK” Frst)) (setq Bname (dxf 2 Tbdata)) ;print all block names. (if (/= Bname nil) ;Discard dimension blocks. (if (/= “*” (substr…

  • AutoCAD lisp Shortcuts

    ;;; SHORCUTS BY V. MENDEZ   ;;; SHORCUTS BY V. MENDEZ ;SHOWS THE BLOCK NAME OF AN ENTITY (DEFUN C:BB(/ bb name) (SETQ bb(entget(car(entsel)))) (SETQ name (cdr(assoc 2 bb))) (SETQ name (strcat “Block Name… ” name)) (ALERT name) (princ) ) ;SHOWS THE LAYER NAME OF AN ENTITY (DEFUN C:CC(/ bb name) (SETQ bb(entget(car(entsel)))) (SETQ name…

  • Block AutoLISP Shortcuts

    ;;; SHORCUTS BY V. MENDEZ ;SHOWS THE BLOCK NAME OF AN ENTITY (DEFUN C:BB(/ bb name) (SETQ bb(entget(car(entsel)))) (SETQ name (cdr(assoc 2 bb))) (SETQ name (strcat “Block Name… ” name)) (ALERT name) (princ) ) ;SHOWS THE LAYER NAME OF AN ENTITY (DEFUN C:CC(/ bb name) (SETQ bb(entget(car(entsel)))) (SETQ name (cdr(assoc 8 bb))) (SETQ name (strcat…

  • FLC Simulation

    A computer simulation application that applies statistical mechanics to predict pre-synthesis of Liquid Crystal properties from chemical structure is needed. As well as the creation of calculation, videoand data manipulation tools and a user interface. read more …

  • How to Fill Orthogonal Polygons with Grid Points in CAD and Geometry

    Problem: There is a closed polygon perimeter. All vertexes are in a right angle (orthogonal) . How to create a grid inside the polygon if it has 8 vertexes? Solution: A simple orthogonal polygon—a polygon where: This problem sits at the intersection of computational geometry, grid rasterization, and polygon point-inclusion tests. ✅ Problem Setup You…

  • vsnap lisp

    (DEFUN C:VSNAP (/) ; Sept. 25,97. By V.Mendez ; This function centers an object between two parallel lines. (SETVAR “CMDECHO” 0) (SETQ SelObj (ENTSEL “\nSelect Object : “)) (SETQ BPoint (GETPOINT “\nBase Point : “)) (COMMAND “OSNAP” “NONE”) (COMMAND “OSNAP” “NEA”) (SETQ Point1 (GETPOINT “\nFirst Point [nearest] : “)) (COMMAND “OSNAP” “PER”) (SETQ Point2 (GETPOINT…