Default distance for dynamic input

Default distance for dynamic input

sgrya1
Advocate Advocate
1,468 Views
7 Replies
Message 1 of 8

Default distance for dynamic input

sgrya1
Advocate
Advocate

A lot of the offset distances I use are the same number so I am CONSTANTLY typing in the number 125.

Is there a way I can have a keyboard shortcut which would enters "125" into the dynamic input box and hits enter for me?

 

Like I hit D" and it would do that for me?

 

 

 

 

 

0 Likes
Accepted solutions (1)
1,469 Views
7 Replies
Replies (7)
Message 2 of 8

ВeekeeCZ
Consultant
Consultant

- You can't hit just D. You can hit 'which would run a simple routine, but that loose the point, typing 125 would be faster.

 

- You can assign a function key to do that. One hit can fill 125 with or without <enter> at the end. Universal, you can use it in other commands, not just OFFSET.

 

- You can have a routine called D, which runs a regular OFFSET with 125 under last options <125> 

 

(defun c:D nil
  (setvar 'OFFSETDIST 125)
  (command "_.OFFSET")
  (princ)
)

- You can pre-select 125 for OFFSET's "last" option just with a drawing launch.

 

(setvar 'OFFSETDIST 125) - This line has to be run on the start. You can use acaddoc.lsp, see HELP for more information.

0 Likes
Message 3 of 8

imadHabash
Mentor
Mentor

HI,

 

usually OFFSET command keep the last distance you enter.no need to always enter the number.

 

Command: OFFSET
Current settings: Erase source=No Layer=Source OFFSETGAPTYPE=0
Specify offset distance or [Through/Erase/Layer] <125.0000>:

Imad Habash

EESignature

0 Likes
Message 4 of 8

SRSDS
Advisor
Advisor

Apologies. I didn't explain this correctly. Can you ignore the 'offset' term. It's often what I need to do but via dynamic input and _from command.

 

Basically, I want to be able to click on a line, for the dynamic input box to appear, and then hit a shortcut key that would enter '125' and then exit the command. This would make the line 125mm long, for example.

 

 

 

0 Likes
Message 5 of 8

dbroad
Mentor
Mentor

CTRL+V would save one keystroke, assuming you'd copied the value earlier.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 6 of 8

SRSDS
Advisor
Advisor

Realized that I haven't explained it properly again...

 

One option is inputting '125' after the _from command.

Another would be entering '125' via the dynamic input.

 

 

I'm thinking the only way is using the 3rd party AutoHotKey programme and setting up a routine.

 

A lisp probably wouldn't work while a command is active nor any other method.

0 Likes
Message 7 of 8

ВeekeeCZ
Consultant
Consultant
Accepted solution

As I proposed earlier...

 

Go to CUI, create new command, name it e.g. '125', add a macro 125, add this command between Keyboard shortcuts and assign some shortcut you don't use. You can even assign some F-key, if there is a one which you don't use.

 

See the SCREENCAST

Message 8 of 8

john.vellek
Alumni
Alumni

Hi @sgrya1,

 

Did @ВeekeeCZ's suggestion help you to create your button?  Once you have it created you could even set it to read a variable. Then when you start a drawing you can set the proper value for the variable when you start.

 

For instance, if you set the variable name to "My_Num" in your button, at the command line you would just have to SetQ My_Num "125"

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes