+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Super Member Lt Dan's legs's Avatar
    Using
    AutoCAD 2007
    Join Date
    May 2010
    Location
    Florida
    Posts
    574

    Default Menu while command is active

    Registered forum members do not see this ad.

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

    example:
    Code:
    Command: ML
    
    Current settings: Justification = Zero, Scale = 1.00, Style = BWALL
    Specify start point or [Justification/Scale/STyle]:
    Autolisp response please

  2. #2
    Super Member Lt Dan's legs's Avatar
    Using
    AutoCAD 2007
    Join Date
    May 2010
    Location
    Florida
    Posts
    574

    Default

    Quote Originally Posted by Lt Dan's legs View Post
    How do you offer options while still having the command active? How about displaying current settings?

    example:
    Code:
    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.
    Code:
    menucmd
    still wondering about the settings display

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,879

    Default

    No need for menucmd.

    All the GetXXX functions will honour keywords - use initget.

    As for the current settings, just use a princ call.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  4. #4
    Super Member Lt Dan's legs's Avatar
    Using
    AutoCAD 2007
    Join Date
    May 2010
    Location
    Florida
    Posts
    574

    Default

    Quote Originally Posted by Lee Mac View Post
    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

  5. #5
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,144

    Default

    Quote Originally Posted by Lee Mac View Post
    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.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  6. #6
    Super Member Lt Dan's legs's Avatar
    Using
    AutoCAD 2007
    Join Date
    May 2010
    Location
    Florida
    Posts
    574

    Default

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

    one more question
    Code:
    (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
    Code:
    (progn wait
    ...Maybe the routine had errors
    Last edited by Lt Dan's legs; 16th Jul 2010 at 04:01 pm. Reason: Adding notes

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,879

    Default

    Quote Originally Posted by Lt Dan's legs View Post
    one more question
    Code:
    (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
    Code:
    (progn wait
    ...Maybe the routine had errors
    I don't know what you mean?
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  8. #8
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,363

    Default

    Registered forum members do not see this ad.

    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.

    Code:
    (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

Similar Threads

  1. Layer Control while command active
    By qball in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 5
    Last Post: 6th Feb 2009, 10:07 pm
  2. Menu Command
    By J_Melcher in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 16th Dec 2008, 04:00 pm
  3. Stopping an active command in VB.Net
    By bsamc2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 3rd Jan 2008, 07:25 pm
  4. keeping the same command active without having to keep retyping it
    By Brian in forum AutoCAD Drawing Management & Output
    Replies: 18
    Last Post: 1st Nov 2007, 01:05 pm
  5. HOW TO CANCEL ACTIVE COMMAND USING VB
    By supils in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 22nd Feb 2005, 11:38 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts