Jump to content

Problem with this marco


jonathann3891

Recommended Posts

I have a custom dimension toolbar. I'm using this macro

^P^C^C(chklyr_desc "_gen_Dimn" "125" "continuous" "Dimensions" "p");_dimassoc;2;_dimlinear;'graphscr;\\\_-layer;s;!cl;;

 

It works fine, but I cant right click to activate it again. If I do it activates the -layer command, leaving me to select an option.

 

I've tried numerous times to solve the problem, but I cant seem to figure it out.

 

I hope someone here can help me out.

 

Thanks!

Link to comment
Share on other sites

Hey there Jonathan. Unfortunately the right click can only repeat the last command. This means even when you run a macro, AutoCAD sees it as a series of commands, and will only repeat the last one.

 

With dimension macros, I put an "*" at the start of the macro to automatically repeat it until you right-click or hit escape. The star "*" sets up a loop of the whole macro, not just the last command.

 

Just like this:

*^P^C^C(chklyr_desc "_gen_Dimn" "125" "continuous" "Dimensions" "p");_dimassoc;2;_dimlinear;'graphscr;\\\_-layer;s;!cl;;

Link to comment
Share on other sites

As an additional note to what YZ has already said, using macro's from a toolpalette makes the macro independant. If you have the macro in the cui and from there use it in a menu, ribbon or toolbar then it can be accessed from the richt click menu

Link to comment
Share on other sites

Hey there Jonathan. Unfortunately the right click can only repeat the last command. This means even when you run a macro, AutoCAD sees it as a series of commands, and will only repeat the last one.

 

With dimension macros, I put an "*" at the start of the macro to automatically repeat it until you right-click or hit escape. The star "*" sets up a loop of the whole macro, not just the last command.

 

Just like this:

*^P^C^C(chklyr_desc "_gen_Dimn" "125" "continuous" "Dimensions" "p");_dimassoc;2;_dimlinear;'graphscr;\\\_-layer;s;!cl;;

 

I put the "*" at the start of the macro, but its not looping?

Link to comment
Share on other sites

As an additional note to what YZ has already said, using macro's from a toolpalette makes the macro independant. If you have the macro in the cui and from there use it in a menu, ribbon or toolbar then it can be accessed from the richt click menu

 

I'm using CUI

Link to comment
Share on other sites

Unfortunately I cannot use LISP so no way to check your macro. What I would do in cases like this is reduce the macro to just a single command, and check that it works with the right click, and presuming it does then add back elements one piece at a time to see if you can find at which point it breaks. If it doesn't work for just a simple command then you would need to dig deeper. It might give someone else a clue if you could post a copy of your command line history from when you start the command and also when you try the right click.

Link to comment
Share on other sites

Sorry, I may have misled you. The "*" works in a macro, but I do not know how it behaves in a lisp function.

 

steven-g, the right click will work if there is only one command in the macro, as soon as you put 2 or more, then the right click will only repeat the final command in the macro, not the preceding commands.

Link to comment
Share on other sites

YZ where is your macro, if it is a toolpalette then that is the behaviour you get, but if it is in the CUI and used in a menu etc, then it should show up as a named macro in the right click menu, unless there is a setting somewhere there it having an effect

Link to comment
Share on other sites

My macro is in the CUI in a custom button then in a ribbon panel.

 

Perhaps the OP has it in there CUI in the right-click menu. I don't know.

 

But if they are using lisp, then it is not really a macro that I am familiar enough with to comment on.

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...