Code Red > AutoLISP (Vanilla / Visual)

entsel with ability enter numbers?

(1/2) > >>

V@no:
Is there a way prompt user to select an entity and at the same time accept a number as input?

Thank you.

BIGAL:
Do you mean select 5 objects but using ssget filters ? Using repeat may be the way to go. And look at Lee-Mac ssget functions, in particular :E

V@no:
SSGET might not be what I'm looking for, because it returns selected entity instead of prompt user (I need prompt user to select 2 entities individually, and keep first entity selected, while picking second one)

V@no:
My current hack is to include numbers in INITGET:

--- Code - Auto/Visual Lisp: ---(DEFUN c:test (/ commands i input)      (SETQ commands ""          i        -1    )    (REPEAT 101         (SETQ commands (STRCAT commands " " (ITOA (SETQ i (1+ i)))))    )    (INITGET commands)    (SETQ input (ENTSEL "\nSelect object or enter a number 0-100: "))    (IF (= (TYPE input) 'STR)         (SETQ input (ATOI input))    )    (PRINC "\nresult: ")    (PRINC input)    (PRINC))It works for my needs, but it's just an ugly hack...

BIGAL:
Why not for 2 entities use entsel can have messages etc just do twice.


--- Code: ---(setq ent1 (car (entsel "\Please pick object 1 ")))
(setq ent2  (car (entsel "\Please pick object 2 ")))
--- End code ---

You can use (ssget pt) which selects a single item (ssname ss 0) useful if you want to show a drag line.

Navigation

[0] Message Index

[#] Next page

Go to full version