Highlighting Keywords

Highlighting Keywords

GeeHaa
Collaborator Collaborator
1,755 Views
2 Replies
Message 1 of 3

Highlighting Keywords

GeeHaa
Collaborator
Collaborator

Hi

 

Is there a way to get the command prompt keywords to Highlight with AutoLisp? I can do it in vb.net but with Autolisp I can't get them to highlight. Ive tried Initget and VLA-INITIALIZEUSERINPUT.

 

Thanks

0 Likes
Accepted solutions (1)
1,756 Views
2 Replies
Replies (2)
Message 2 of 3

Moshe-A
Mentor
Mentor
Accepted solution

@GeeHaa  hi,

 

you mean some thing like this?

(getxxxx "\nEnter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness]: ")

if in (getxxxx) functions you use the prompt argument and specifies key words and put them in square brackets, then the uppercase letter(s) is blue highlighted exactly the same as ordinary commands.

this means that you can also select the keyword with mouse pick and if you above that call

(initget "Color LAyer LType ltScale LWeight Thickness")

the function will return the keyword.

 

Moshe

 

 

 

0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

@GeeHaa wrote:

.... Is there a way to get the command prompt keywords to Highlight with AutoLisp? ....


 

If you construct the prompt with the options in square brackets with initial letters matching a preceding (initget) function's options, and with forward-slash separators, they will do that as in regular AutoCAD commands.  An example, from my MakeMore.lsp routine, when the selected object you want to Make More of is a LWPolyline, offering options for the different commands that can make them, i.e. that might have been what made the one you selected:

 

    (initget "PLine Rectangle POlygon Donut Cloud Boundary Sketch")
    (setq
      S2
        (getkword
          (strcat
            "\nPolyline Type [PLine/Rectangle/POlygon/Donut/Cloud/Boundary/Sketch] <"
            S1
            ">: "
          ); strcat
        ); getkword
      S2 (cond (S2) (S1)); use User entry, or default for Enter
    ); setq 

 

Kent Cooper, AIA
0 Likes