Alias for "Laymch" name option

Alias for "Laymch" name option

Intuos5
Advisor Advisor
899 Views
10 Replies
Message 1 of 11

Alias for "Laymch" name option

Intuos5
Advisor
Advisor

Is it possible to assign "CL" to the command Laymch with the option name as default? This is the way I set things up in Rhino and would like for the UI pop-up to be called each time I use the command.

0 Likes
Accepted solutions (2)
900 Views
10 Replies
  • UI
Replies (10)
Message 2 of 11

ВeekeeCZ
Consultant
Consultant

Express Tools / Tools / Command Aliases / Add...

0 Likes
Message 3 of 11

Intuos5
Advisor
Advisor

Then where do I specify the "N" [name] + "Enter"? I would like those to be part of the macro/ alias.

0 Likes
Message 4 of 11

ВeekeeCZ
Consultant
Consultant

That's not possible with aliases.

For this, you can either have a tool on Toolpalette (simple, but run by a mouse click) or a keyboard shortcut (eg ctrl+alt+m).

Or a LISP. Ony this gives you the ability to create a command name (similarly as an alias)

0 Likes
Message 5 of 11

Intuos5
Advisor
Advisor

So in that case, I would need to create an LISP and assign an alias to that. Though I am not familiar with LISP or programming in general, so I am hoping someone could lend me a hand.

0 Likes
Message 6 of 11

ВeekeeCZ
Consultant
Consultant

So you want to just select objects, type a command, pick a target layer from a list?

0 Likes
Message 7 of 11

Intuos5
Advisor
Advisor

@ВeekeeCZ wrote:

So you want to just select objects, type a command, pick a target layer from a list?


Yes, that's the desired workflow.

And I like that this dialog allows you to type in the layer, so by naming the layers with a number prefix, I type the number and hit enter.

0 Likes
Message 8 of 11

ВeekeeCZ
Consultant
Consultant
Accepted solution

Use some of THESE methods to load a lisp...

 

(defun c:LaymchD ( / s)
  (if (setq s (ssget "_:L"))
    (progn
      (initcommandversion)
      (command "_.laymch" s "" "_n")))
  (princ)
  )

 

Message 9 of 11

Intuos5
Advisor
Advisor

Thank you very much.

I may be missing something though, I changed the LISP name to ChangeToLayer, like so:

(defun c:ChangeToLayer ( / s)
  (if (setq s (ssget "_:L"))
    (progn
      (initcommandversion)
      (command "_.laymch" s "" "_n")))
  (princ)
  )

 Ran it through appload for the .lsp file, closed and opened autocad, reinitiated the .pgp, but it still won't find the command in _aliasedit. Sorry for such a basic question, but I cannot find an answer through searching... 😅

0 Likes
Message 10 of 11

ВeekeeCZ
Consultant
Consultant
Accepted solution

It probably won't be there.

I think that you can simply type in the command name manually as it's not listed in the dropdown.

 

Anyway, you can also do this manually - as I always do. Click on the big "A" menu, type PGP, pick "Edit pgp.." and add your new alias to the very end of the file. Syntax is:

alias, *command name

better leave the last line empty.

 

Also, use the Start-up suitcase in the appload command to have your LSIP command always loaded.

 

Message 11 of 11

Intuos5
Advisor
Advisor

Perfect, got it. Thank you very much, I'll be using this extensively 😄

0 Likes