Jump to content

Menu while command is active


Lt Dan's legs

Recommended Posts

How do you offer options while still having the command active? How about displaying current settings?

 

example:

Command: ML

Current settings: Justification = Zero, Scale = 1.00, Style = BWALL
Specify start point or [Justification/Scale/STyle]:

 

Autolisp response please

Link to comment
Share on other sites

How do you offer options while still having the command active? How about displaying current settings?

 

example:

Command: ML

Current settings: Justification = Zero, Scale = 1.00, Style = BWALL
Specify start point or [Justification/Scale/STyle]:

 

Autolisp response please

 

I found the first part.

menucmd

 

still wondering about the settings display

Link to comment
Share on other sites

No need for menucmd.

 

All the GetXXX functions will honour keywords - use initget.

 

As for the current settings, just use a princ call.

 

When I put in menucmd I was looking at the old dline lisp. I thought I figured it out but by the time I realized it wasn't it you answered my question.

 

I thought there was a different way of doing princ call but seems like this is the best way.

 

Thank you :D

Link to comment
Share on other sites

No need for menucmd.

 

All the GetXXX functions will honour keywords - use initget.

 

As for the current settings, just use a princ call.

Except getstring, for obvious reasons.

Link to comment
Share on other sites

I got my program to work the way I wanted. Many thanks Lee!

 

one more question

(setq wait t)
(while wait ...

 

Will this only work for while or is there other commands I can use this with?

 

 

 

___

I had problems with

(progn wait

...Maybe the routine had errors

Link to comment
Share on other sites

one more question

(setq wait t)
(while wait ...

Will this only work for while or is there other commands I can use this with?

 

 

 

___

I had problems with

(progn wait

...Maybe the routine had errors

 

I don't know what you mean?

Link to comment
Share on other sites

Do you need a form that shows all the current settings and if correct press Ok else pick box and change this could be written as a seperate defun and just called as a step at the start of your program.

 

Or princ all the results as per Lee Mac and just press enter if ok, any other key would mean change this is pretty quick in a program and you dont need to code a dcl if in lisp. I use this enter method a lot very easy for everyone to use at our work.

 

(princ "all your values here")
(setq ans (getstring ans "\nIf values ok press <Cr> else any key"))
(IF (= ans NIL)
(princ)
(setnewvals)
)

(defun newvals ()
(princ styleval)
(setq ans (getstring ans "\nIf values ok press <Cr> else any key"))
(IF (= ans NIL)
(princ)
(progn
(setq styleval (Getstring "\nEnter new style name"))
(setvar "stylname" stylname)   ; I can nor rember style variable
)
)
just repeat for all other vaules may mean you press Cr Cr enter val Cr Cr etc

 

Hopes this may be of use

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...