Search the Community
Showing results for tags 'sequence'.
-
Hi, I'm new to writing LISP's and have finnished a couple for my studio. Just to keep busy when tides are low. The last I'm almost done with is an offset lisp that offsets in sequence (I do't really care if there are lisps already made for this, I've been trying to practice on my lisp routine making). I first choose the number of offsets, then the value for each offset and finally the side to offset. My problem is that when I zoom in close to the line the lisp works great - I mean, it offsets to the valeus I inputed. But when I'm a bit far out on the zoom it offsets to different values. I really don't know why it is doing this. Do I need to adjust the zoom sesitivity or something? Is there such a thing? Here is the code I wrote (it's in portuguese). Don't mind the messy way it's wirten. Thanks ;Criado por Rodrigo Líbano (defun c:offseq (/ numof numof2 numof3 list carl carls carlss voffx vof2x vof1x p2x side) (initget 7) (setq numof (getint "\nNúmero de offsets [2 ou mais]:")) (initget 7) (setq voffx (getdist "\nValor do primeiro offset:")) (setq numof (- numof 1)) (setq numof2 numof) (setq numof3 numof) (setq list (cons voffx voffx)) (setq vof1x voffx) (while numof (initget 7) (setq vof2x (getdist (strcat "\nValor do próximo offset [Restam:" (rtos numof 2 0)"]:"))) (setq vof2x (+ vof2x vof1x)) (setq list (cons vof2x list)) (setq vof1x vof2x) (setq numof (1- numof)) (if (= numof 0) (setq numof nil) (setq numof numof) ) ); end while (princ list) (setq carlss carls) (while (setq p2x (cadr (entsel "\nSelecione Objeto:"))) (setq side (getpoint "\nSelecione lado:")) (while numof2 (setq carl (nth numof2 list)) (if (= numof2 numof3) (setq carls (- carl carl)) (setq carls (nth (+ numof2 1) list)) ); end if (setq carls (- carl carls)) (setvar "OFFSETDIST" carl) (command "._UNDO" "_GROUP") (command ".OFFSET" carl p2x side "") (if (= numof2 0) (setq numof2 nil) (setq numof2 (- numof2 1)) ); end if ); end while (setq numof2 numof3) (setq carl carlss) ); end while (princ) )