Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DRAGMODE on/off toggle with Macro (or LISP?)

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
Haider_of_Sweden
1826 Views, 16 Replies

DRAGMODE on/off toggle with Macro (or LISP?)

Hello,

 

could someone please help me to create DRAGMODE ON / OFF toggle with Macro, or maybe LISP

 

Thank you in advance!

16 REPLIES 16
Message 2 of 17

Hi @Haider_of_Sweden

 

Why not create three buttons in your CUI?  I added one to one of the menus.

 

This is the syntax:

 

Capture.PNG

 

 

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
Message 3 of 17

Hi,

 

if i understand your need right ... i suggest to try this :

  • from MANAGE ribbon tab select RECORD or type in the command line ACTRECORD . 
  • a red ball will appear beside your cursor to notify you that you're under record action.
  • now type in the command line DRAGMODE and select ON.
  • from MANAGE ribbon tab select STOP or type in the command line ACTSTOP . 
  • a dialog will appear -----> in Action Macro Command Name enter any unique name that meet your need.

repeat the previous steps to record DRAGMODE = OFF. NOW you have a customize commands name will be active and always whenever you need it.

 

Hope that it's help haider ..

Imad Habash

EESignature

Message 4 of 17
tramber
in reply to: Haider_of_Sweden

'dragmode $M=$(if,$(and,$(getvar,dragmode),2),0,$(+,$(getvar,dragmode),1)) 

This one togles between the 3 values DRAGMODE can have. and transparently

Message 5 of 17
tramber
in reply to: tramber

'dragmode $M=$(if,$(or,$(and,$(getvar,dragmode),1),$(and,$(getvar,dragmode),2)),0,1)

Even simplier !

Message 6 of 17


@tramber wrote:
'dragmode $M=$(if,$(or,$(and,$(getvar,dragmode),1),$(and,$(getvar,dragmode),2)),0,1)

Even simplier !


 

Yes, this looks like what I am searching for.

 

However, if I put it in an .SCR file and drag it into AutoCAD, it wont work. Do you really start with 'dragmode?

Message 7 of 17
tramber
in reply to: Haider_of_Sweden

' before DRAGMODE allows you to click as you excecute any command. But the fact is that it wont show the effect during a draging.. action.

 

Nevertheless, Il should learn you that scripts are pretty different and don't allow any toggling, dont' they ?

' doesn't exists either in a script, as far as I know.

 

My solution stands for a buttton. Scirpting DRAGMODE is strange to me but you are welcome to do it with no DIESEL, no '

!

Message 8 of 17
tramber
in reply to: tramber

Well, sory to publish again but the question of the transparency in script may be asked. I should remember but it's time for me to go and we 'll talk about later on.

Hope I helped.

B

France

Message 9 of 17
Haider_of_Sweden
in reply to: tramber


@tramber wrote:

' before DRAGMODE allows you to click as you excecute any command. But the fact is that it wont show the effect during a draging.. action.

 

Nevertheless, Il should learn you that scripts are pretty different and don't allow any toggling, dont' they ?

' doesn't exists either in a script, as far as I know.

 

My solution stands for a buttton. Scirpting DRAGMODE is strange to me but you are welcome to do it with no DIESEL, no '

!


Unfortunately, this worked neither a shortcut nor button.

Maybe it is not working because of the transparent command? Although, I think transparent DRAGMODE might be rather cool instead of using ^C^C

Message 10 of 17
tramber
in reply to: Haider_of_Sweden

It's about midnight where I live, I have to go Smiley Happy

Yes it works good at my place.

Don't know what is going on...

 

^c^c is not an obligation.

' is cool

Again, I don't know what could be wrong for you with this humble macro

Message 11 of 17
Haider_of_Sweden
in reply to: tramber

Your code resulted in "Invalid option keyword."

GETVAR gives us 0,1 and 2, but the input should be AUTO or OFF. 

 

This is how I solved it;

^C^Cdragmode $M=$(if,$(and,$(getvar,dragmode),2),OFF,AUTO)

A note regarding transparent command in this context. The DRAGMODE effect won't be actualized until next time anyway, so using a transparent command is unfortunately of no use here. I was hoping it actually toggled DRAGMODE on the fly, not toggling it for next time's use.

 

Thank you for laying the ground for me.

Message 12 of 17
tramber
in reply to: Haider_of_Sweden

Well, at least it is a solution.

let's dig it before i fall asleep !

What version are u running ? I'm on 2015 (edited).

And i like to try my 'macro. Look, it's funny to draw a polyline and to click on your button.

 

God. How is it that it doesn't work as I thought it would on any version ?

Message 13 of 17

I am on 2016.

For me it's not interesting using it while drawing polylines, but rather when moving heavy objects. Therefore I don't need the command on the fly but just a quick hotkey under my fingertips instead of typing the command manually.

Toggles are my favorites 🙂
Message 14 of 17
tramber
in reply to: Haider_of_Sweden

Why don't you put the macro in an accelerator then, rather than in a button ?

Anyway, it is still a mystery to me that you seem not to be able to get the same result

Ni______(on)ce We       (off)ek-end !

Message 15 of 17
Haider_of_Sweden
in reply to: tramber

What is an accelerator?

By the way, I put it in a button, just for test purpose. Now I run it as a shortcut.

Message 16 of 17
tramber
in reply to: Haider_of_Sweden

My solution is intended for a button. Not for a script. This is why the ' should work.

Did we misunderstood ?

 

An accelerator is found in the CUI interface and corresponds to a CTRL+C, for exemple.

You may know CTRL+L or CTRL+B, that's an accelerator too (I'm not under English version but I think that it is the word)

Have a look in CUI, it is easy to find.

You can create one, with a '

 

Smiley Wink

Message 17 of 17
tramber
in reply to: tramber

Apologize,

It's named Shortcut, probably what you've done.

Accelerator is the technical word.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report