Jump to content

Recommended Posts

Posted

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.

Posted

Hope the thumb gets better :P

 

(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))

                          

Posted

That was exactly what i was looking for! Me and my thumb greatly appreciates you!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...