johnpieter Posted May 17, 2011 Posted May 17, 2011 here how to give multiple value?i want give multiple values((setvar "plinewid" 1)..so it should ask the value means its easy to give. (defun c:test () (setvar "plinewid" 1) (setvar "cmdecho" 1) (command "pline" pause) (princ) ) Quote
Tharwat Posted May 17, 2011 Posted May 17, 2011 What you mean by multiple values ? when you can change it every time you want . Quote
alanjt Posted May 17, 2011 Posted May 17, 2011 It can be set as you draw your LWPolyline. eg. Command: P PLINE Specify start point: Current line-width is 0.00 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: W Specify starting width <0.00>: 1 Specify ending width <1.00>: 2 Specify next point or [Arc/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: W Specify starting width <2.00>: Specify ending width <2.00>: 1 Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: Quote
BlackBox Posted May 17, 2011 Posted May 17, 2011 (defun c:PLW () (c:PolylineWidth)) (defun c:PolylineWidth ( / *error* width oldCmdecho oldPlinewid) (princ "\rPOLYLINE WIDTH ") (defun *error* (msg) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** Error: " msg " ** ")))) ; Fatal error, display it (and oldPlinewid (setvar 'plinewid oldPlinewid)) (and oldCmdecho (setvar 'cmdecho oldCmdecho)) (princ)) (if (setq width (getreal "\Enter polyline width: ")) (progn (and (setq oldCmdecho (getvar 'cmdecho)) (setvar 'cmdecho 0)) (and (setq oldPlinewid (getvar 'plinewid)) (setvar 'plinewid width)) (command "._pline") (while (= 1 (logand 1 (getvar 'cmdactive))) (princ "\nSpecify next point: ") (command pause)) (and (setvar 'plinewid oldPlinewid) (setvar 'cmdecho oldCmdecho))) (prompt "\n** Invalid entry ** ")) (princ)) Edit - MUCH simpler example (inspired by Alan's reminder): (defun c:PolylineWidth ( / width) (princ "\rPOLYLINE WIDTH ") (if (setq width (getreal "\nEnter polyline width: ")) (command "._pline" pause "_w" width "")) (princ)) 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.