Kate M 发表于 2022-7-6 06:58:22

Lengthen-delta

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

fuccaro 发表于 2022-7-6 07:12:42

like this?

(defun c:ld()(command "lengthen" "de" pause pause "")(princ) )or a bit more complicated, but with the same functionality:

(defun c:ld( / cmd) (setq cmd (getvar "cmdecho")) (setvar "cmdecho" 0) (command "lengthen" "de" pause pause "") (setvar "cmdecho" cmd)(princ) )

Kate M 发表于 2022-7-6 07:18:50

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 :"...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 发表于 2022-7-6 07:25:46

May I try again?
(defun c:test() (setvar "cmdecho" 0) (princ "\n Distance? ") (command "lengthen" "de" pause) (princ) )

Kate M 发表于 2022-7-6 07:37:39

Yay! That's it! Not bad for being on vacation... ;-) Hope you enjoy it!

hyposmurf 发表于 2022-7-6 07:42:00

Where you on vacation Fuccaro?Do you ever stop working?

jdrealtalk 发表于 2022-7-6 07:50:22

I just want to know how to draw a ten feet line using the delta command at the command line.

fuccaro 发表于 2022-7-6 08:00:27

The discussion was about lengthen an existing line.
页: [1]
查看完整版本: Lengthen-delta