jaylo23 Posted June 26, 2009 Posted June 26, 2009 Hello all been gone for awhile great to be back, posted this question on a different thread but i think it was closed, so here goes again. I have a lisp that will use the stretch command incorporating the x and y point filters. The lisp does everthing i want it to do except that i would like it to work a little more like the built in stretch command whereas it highlights everything before it peforms the stretch and gives you the option of deselecting objects you dont want stretched. I am just barely competent in lisp to slap together one so any help is greatly appreciated. Here is lisp: ;******************************** Stretch Object(s) using .y Point Filter ********************************************* (defun C:yST (/ oldsnap sset1 sset2 sset3 base sec *error*) (setq temperr *error*) (setq *error* XYTTrap) (setq oldsnap (getvar"osmode")) (setvar "osmode" 255) (setq sset1 (getpoint "Select Objects: ")) (setq sset2 (getcorner sset1)) (setq sset3 (ssget "_c" sset1 sset2)) (setq base (getpoint "\nSpecify Base Point: ")) (setq sec (getpoint "\nSpecify Second Point: ")) (setvar "osmode" 0) (command "stretch" sset3 "" base ".y" sec "0") (setvar "osmode" oldsnap) (setq *error* temperr) (princ) ) P.S. I didnt write this lisp because i am lazy and dont feel like doing the extra clicks necessary to use point filters, but i have recently dislocated my thumb (looked like something out of a horror movie) and i need to make modeling and designing as pain free and easy as possible. Thanks in advance. Quote
Lee Mac Posted June 26, 2009 Posted June 26, 2009 Hope the thumb gets better (defun c:yst (/ *error* vl ov ss pt1 pt2) (defun *error* (msg) (if ov (mapcar 'setvar vl ov)) (if (not (wcmatch (strcase msg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " msg " >>"))) (princ)) (setq vl '("CMDECHO" "OSMODE") ov (mapcar 'getvar vl)) (mapcar 'setvar vl '(0 255)) (if (setq ss (ssget)) (if (and (setq pt1 (getpoint "\nSelect Base Point: ")) (setq pt2 (getpoint pt1 "\nSelect Second Point: "))) (progn (setvar "OSMODE" 0) (command "_.stretch" ss "" pt1 ".y" pt2 0))) (princ "\n<< Nothing Selected >>")) (mapcar 'setvar vl ov) (princ)) Quote
jaylo23 Posted June 26, 2009 Author Posted June 26, 2009 That was exactly what i was looking for! Me and my thumb greatly appreciates you! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.