Search the Community
Showing results for tags 'selected objects'.
Hi all, I have a lisp routine that i wrote that when i run it, it will wblock out what i need to a separate file just by clicking on the border of the object, it uses the (Useri1) variable to asign the file name which is okay but i would like to be able to click on the part number (B2) for example instead so when people use it the file name is the part number. i would really appreciate any help. (defun c:psave (/ ss mn mx) (vl-load-com) (setvar "cmdecho" 0) (setvar "filedia" 0) (princ "\n Panel Number is ")(princ (getvar "useri1")) (princ ". To change this, reset the system variable USERI1") (setq pnum(getvar "useri1")) (if(= pnum 0)(setq pnum 1)) (setvar "useri1" (+ pnum 1)) (setq pnum(itoa pnum)) (if (setq ss (ssget "_:S:E" '((0 . "INSERT,LWPOLYLINE")))) (progn (vla-getboundingbox (vlax-ename->vla-object (ssname ss 0)) 'mn'mx) (command "wblock" pnum " " "0" "WINDOW" (trans (vlax-safearray->list mn) 0 1) (trans (vlax-safearray->list mx) 0 1) "") (setvar "cmdecho" 1) (setvar "filedia" 1) ) ) ) (princ) Thanks, Brian
Dan Kitchens posted a topic in AutoLISP, Visual LISP & DCLHi peoples, I've got a new challenge: Is there a Lisp that moves selected objects to an exisitng, specified layer? I want to be able to select objects on the screen, type in a short command, and they automatically go to a certain layer (let's call it "Layer 1"). Having looked everywhere on the net, I can't find anything similar, and I don't know enough AutoLISP to be able to write it myself... Thank you in advance! Dan