Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Condition for user input during INSERT command.

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
mdhutchinson
294 Views, 4 Replies

Condition for user input during INSERT command.

I've done plenty of lisp... but for some reason I am drawing a BIG blank...

The prompts below is what I want... expected imput from the user is a point (to locate the 3/8th size in this case) or different size.

... if the user enters 1/2 for example, then the 1/2 size is floating on the cursor and prompting for a point.

 

HELP please!

 

Specify a point, or size <3/8>:  1/2

 

 

Specify a point, or size <1/2>: 

 

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: mdhutchinson

One way

 

(or ans (setq ans "3/8"))
(setq flag t)
(while flag
  (initget "3/8 1/2")
  (setq ans (setq p1 (getpoint (strcat "\nSpecify a point, or size [" ans "] <exit>: "))))
  (cond ((= 'list (type ans))
         (prompt "\nUser have chosen a point... ")
         (setq flag nil)
        )
        ((wcmatch ans "3/8,1/2")
         (prompt "\nUser did enter a size...")
        )
        ((= ans nil)
         (setq flag nil)
         (prompt "\nUser want to exit...")
        )
  )
)

 

 

Henrique

EESignature

Message 3 of 5
mdhutchinson
in reply to: hmsilva

Sorry... I wasn't quite clear I guess...

I want the 3/8 th sized object to be floating on the cursor at the prompt... if the user types 1/2 then the 1/2 sized object would be floating on the cursor.

 

Specify a point, or size <3/8>: 

Message 4 of 5
Kent1Cooper
in reply to: mdhutchinson


@mdhutchinson wrote:

...

The prompts below is what I want... expected imput from the user is a point (to locate the 3/8th size in this case) or different size.

... if the user enters 1/2 for example, then the 1/2 size is floating on the cursor and prompting for a point.

.... 

Specify a point, or size <3/8>:  1/2

Specify a point, or size <1/2>: 


Is this about Inserting a Block representing the 1/2- or 3/8-size version of something?  I think that would make it more complicated.  It would need to be in an Insert command for the Block image to be "floating on the cursor," and if the User enters a different size, it would need to cancel the current Insert command, and start another using the new size's Block name.  That part probably isn't too hard, but the big problem I see is that if it's asking for an insertion point from inside a (getpoint) function, the dynamic image of the Block will not be "floating on the cursor" as it will be if the Insert command's prompt is what's doing the asking.  I'm not sure whether there's any way around that.

Kent Cooper, AIA
Message 5 of 5
3wood
in reply to: mdhutchinson

The quickest way: Just drag different sized blocks into a tool palette to create different tools. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost