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

2021 Has Messed With My Macro

2 REPLIES 2
Reply
Message 1 of 3
ALEXF3ZMZV
327 Views, 2 Replies

2021 Has Messed With My Macro

Hey All,

 

Having a bit of a hiccup since switching to 2021 ACAD. We've got a fairly simple macro we use instead of an AutoCAD leader command for things such as notes and markups. 

 

The macro is:  ^C^CLINE;\'AUTOSNAP;63;\;CIRCLE;2P;@;\MTEXT;CEN;@;H;8;J;MC;@;TEXTSIZE;4;

 

And this is a quick look at what it should do when working properly:

 

MARK UP.png

 

 

Here is what the command line should look like when it is working as intended:

 

WORKING.png

 

 

The problem we are having is that periodically the command cant find the center of the circle when starting the mtext. Here is what the command line looks like when this happens.

 

ERROR.png

 

The problem is "No Center found for specified point". This will happen occasionally when using the macro. Maybe one out of every 20 or 30 times using the macro. We also have one person who has it happen after opening up a drawing. He opens a drawing, runs the macro right away and every time it will error out with the "No Center found for specified point" problem. Then if right afterwards he runs the macro again it will work perfectly fine as intended.

 

This has never happened in any of the other ACAD versions we have run and it started immediately after switching to 2021. Any input from the FORUM would be greatly appreciated!

Labels (5)
2 REPLIES 2
Message 2 of 3
Kent1Cooper
in reply to: ALEXF3ZMZV

It looks like what's happening is that at least some of the semicolons in the macro are not registering as Enters the way they should.  The  CIRCLE2P@  in your image should be going in separately as  CIRCLE  2P  @  and prompts should appear between them -- after the  @  it should ask for a point for the other side of the Circle, which it isn't doing.  So there's no Circle for the Mtext insertion point to Osnap to the Center of, even if that itself were not likewise spoiled by being collapsed to  CEN@ .  Likewise with the  'AUTOSNAP63  .

 

As an experiment, try using spaces instead of semicolons, since I think all of what those semicolons are doing can be done with either a space or an Enter.  If the issue is somehow a non-reading of semicolons [however that could possibly happen, and whether or not anything can be done about it], as long as it's reading spaces correctly, the macro should work.

 

And it occurs to me to wonder, considering how semicolons could be mis-read, whether the macro code might have been brought in from being written in a word processor instead of a plain-text editor such as Notepad.  In word processors, certain punctuation characters can be automatically made "special" [such as the difference between beginning quotation marks that look like little 6's and ending ones that look like little 9's].  If there's some "special" variant on a semicolon, and if that's what's in some places in the macro, though it looks like a semicolon, it would really be something else, which could explain its being mis-read or un-read.  If you copy the macro content into Notepad, it should convert such a "special" semicolon into a "basic" one, so that if you then copy it from there and paste it back into the macro, it may work right.  [On the other hand, if that's the problem, I would expect the current content to never work correctly.]

Kent Cooper, AIA
Message 3 of 3
ALEXF3ZMZV
in reply to: Kent1Cooper

That was an interesting idea so I removed all the semicolons and tried it with spaces. The result was exactly the same. I noticed as well that the cen@ and the circle2p@ ran together in the prompt. However the result is still correct as if you manually typed in circle(enter)2p(enter)@(enter) or cen(enter)@(enter). It is confusing that the prompts shows it running together but it does everything exactly as intended with the exception of the seemingly random occasional "No Center found for specified point" error.

 

After the 2p;@; in my macro there is a \ which is where you are prompted for the second point of the circle so that is not the issue. Also the macro was made in notepad so that is not the issue either. I'm honestly pretty stumped with what may be causing this.

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

Post to forums  

Forma Design Contest


AutoCAD Beta