Jump to content

customization of 'cal command


Recommended Posts

Hello to all.

Some of you might know that whenever you might use an expression to determine the input value. For example you want a line with length of 20 you can always run command “line” and when prompted for the length write ‘cal and then 10*2. This will give line length of 20 units. What I am looking for is a way to change the ‘cal command as it’s too long for me to type it each time. Any ideas how to achieve this?

Link to comment
Share on other sites

Before 'Mid Between 2 Points' was added to the 'Object Snap Cursor Menu'

_none;'CAL;(cur+cur)/2;

was a commonly used macro. There are many others.

 

You haven't said what you want to do with it but adding 'CAL macros would make them easier than typing them out. 

With lisp you could create a command with prompts and options.

  • Like 1
Link to comment
Share on other sites

You can call transparent commands within a lot of commands.

 

M2P comes to mind built in as per tombu. See '2

 

Do Line then '2 then '4 then '2 etc the ' implies transparent then runs the defun.

 

(defun c:2 ()(CAL "(end+end)/2.0"))
(defun c:3 ()(CAL "plt(end,end,1/3.0"))
(defun c:4 ()(CAL "plt(end,end,0.25)"))

 

This was mentioned in another post recently  how do to a length of x units in a direction maybe a week ago, for ortho lines pick 1st point drag mouse type value eg 20. Very quick for X & Y type lines.

 

 

Link to comment
Share on other sites

You can add a command alias to your pgp file so you only need type an apostrophe folowed by a single keyboard letter, so at the end of the pgp file add this (I just picked 'K' because 'C' is used so often for other things.

K,    *CAL

So when you want to use the CAL command transparently you only need type 'K unfortunately you cannot add

K,   *'CAL

as an alias the apostrophy isn't accepted as a valid entry, but using something like 'K still saves 50% of your keypresses. You do need to run the REINIT command after you save the pgp file to make changes to your pgp file available to use.

Or you could create a new command in the CUI

'CAL

and run it from an icon in your ribbon or a toolpalette with a single mouse click (but that might not be any quicker if you have to move the mouse to an icon everytime you need it.

Edited by steven-g
  • Like 1
Link to comment
Share on other sites

If you are inclined to go with steven-g's suggestion, try using the aliasedit command to access your PGP file easily on the fly.

 

As shown in this screenshot.

image.thumb.png.57a0b12a539c6a980035eb335bc47fdf.png

Done this way you won't need to run the REINIT command, but DO make sure you click the confirmation OK buttons as you click out of each dialog box.

 

 

 

 

 

 

 

 

 

 

 

 

image.png

image.png

image.png

Edited by Dadgad
Trying to delete multiple insertions.
Link to comment
Share on other sites

@steven-g +1.

 

You are well known to be a wizard of LT and inclined to find clever ways to coax it into doing things it is not designed to do!   :beer:

I used to always edit my customizations at the very bottom section of the PGP, but done this way, that is where they go by default, so that at a later

date they will migrate with an upgrade to a newer version.

  • Like 1
Link to comment
Share on other sites

Dadgad can see numbers being used stops any probs with shortcut alpha keys, 47 is osmode 47.

 

Re lengths made U D L R lisp

Type l123 u45 r56.76 d34.6 etc draws ortho lines in direction up down etc. 

  • Like 1
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...