PDA

View Full Version : Lengthen-delta



Kate M
3rd Dec 2003, 08:55 pm
Hey guys,

I just tried to make my very first lisp routine -- it's supposed to choose the delta option in the lengthen command so I don't have to. It seems to work fine, but I can't figure out how to keep it from displaying two lines of "enter delta length." I tried removing the (princ), but then it put "nil" after the first line -- the command still worked. Any suggestions on fixing this? Thanks!!

-Kate


;;;Lengthen Delta

(defun c:ld()
(command "lengthen" "de")
(princ)
)


Command: ld
lengthen
Select an object or [DElta/Percent/Total/DYnamic]: de
Enter delta length or [Angle] <-1'-0">:
Enter delta length or [Angle] <-1'-0">: 6

fuccaro
4th Dec 2003, 07:56 am
like this?

&#40;defun c&#58;ld&#40;&#41;
&#40;command "lengthen" "de" pause pause ""&#41;
&#40;princ&#41;
&#41;
or a bit more complicated, but with the same functionality:

&#40;defun c&#58;ld&#40; / cmd&#41;
&#40;setq cmd &#40;getvar "cmdecho"&#41;&#41;
&#40;setvar "cmdecho" 0&#41;
&#40;command "lengthen" "de" pause pause ""&#41;
&#40;setvar "cmdecho" cmd&#41;
&#40;princ&#41;
&#41;

Kate M
5th Dec 2003, 09:01 pm
Fuccaro,

The first one *almost* works...but it ends after one pick (I think that's the "" at the end?) -- I tried playing around with deleting the pauses, but that put in extra lines around the "Select an object to change or [Undo]:"...not quite as annoying as it was when I first tried the lisp, but I'm still not quite sure where the extra lines are coming from.

fuccaro
9th Dec 2003, 09:10 pm
May I try again?
&#40;defun c&#58;test&#40;&#41;
&#40;setvar "cmdecho" 0&#41;
&#40;princ "\n Distance? "&#41;
&#40;command "lengthen" "de" pause&#41;
&#40;princ&#41;
&#41;

Kate M
9th Dec 2003, 10:08 pm
Yay! That's it! Not bad for being on vacation... ;-) Hope you enjoy it!

hyposmurf
10th Dec 2003, 02:19 pm
Where you on vacation Fuccaro?Do you ever stop working? :)

jdrealtalk
5th Feb 2013, 10:04 pm
I just want to know how to draw a ten feet line using the delta command at the command line.

fuccaro
7th Feb 2013, 07:14 am
The discussion was about lengthen an existing line.