Command macro syntax error, adds extra enter at end

Command macro syntax error, adds extra enter at end

julie.walker2
Enthusiast Enthusiast
1,468 Views
6 Replies
Message 1 of 7

Command macro syntax error, adds extra enter at end

julie.walker2
Enthusiast
Enthusiast

Could someone please tell me what I'm doing wrong in this command macro? I have various other command buttons where the macro ends with a ";" or ends with a space or even ends with a carriage return to the next line, and they still work somehow - the command excecutes, and is done, nothing, the end. This one keeps restarting the previous command as if I'd hit the space bar or enter again. If I do these steps manually from the command line, it works. Perhaps I need to make this into a LISP instead? Drives me nuts. I have to insert different sets of blocks and layers all day long, so regular purges are necessary.

Command macro:

^C^C-purge;r;;n;-purge;a;;n;

This is my work ID, since now your ID is associated with your software.
My other ID is Julesagainn.
AutoCAD user since 1988.
0 Likes
Accepted solutions (2)
1,469 Views
6 Replies
Replies (6)
Message 2 of 7

julie.walker2
Enthusiast
Enthusiast

Apparently I can't edit - wanted to say I've tried it with nothing at the end, a return at the end, and a space at the end. None of it works.

 

 

This is my work ID, since now your ID is associated with your software.
My other ID is Julesagainn.
AutoCAD user since 1988.
0 Likes
Message 3 of 7

TomBeauford
Advisor
Advisor
Accepted solution

Try: 

^C^C-purge;r;;n;;;a;;n;

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes
Message 4 of 7

SeeMSixty7
Advisor
Advisor

What version of AutoCAD are we talking about? I just tried it in AutoCAD 2018 and it works as expected. 

Possibly the custom command macro is messed up. Have you tried deleting the custom command from the customization file and then creating a new one?

 

Hope that helps somehow or another. Good luck

0 Likes
Message 5 of 7

julie.walker2
Enthusiast
Enthusiast
Accepted solution

Thanks Tom, I'm not sure what the problem was yesterday, but this morning I tried it without anything after the last "n" and it worked. Supposedly the macros are supposed to act as if there is an invisible "enter" command at the end, but that wasn't working. Now it is. ?? No idea why, nothing else was changed. This new snippet of code threw out the same error, an extra ";" at the end. 

The reason I had the second purge command in there is it sometimes goes so fast it doesn't catch the modifier when I reinvoke purge using the ";". So I get this:

 

 

Command:

Command: -purge

 

Enter type of unused objects to purge Blocks/DEtailviewstyles/Dimstyles/Groups/LAyers/LTypes/MAterials/MUltileaderstyles/Plotstyles/SHapes/textSTyles/Mlinestyles/SEctionviewstyles/Tablestyles/Visualstyles/Regapps/Zero-length geometry/Empty text objects/Orphaned data/All]: r


Enter name(s) to purge <*>:

Verify each name to be purged? [Yes/No] : n

Deleting registered application "AcadAnnoPO".

Deleting registered application "DCO15".

2 registered applications deleted.

 

Command:
-PURGE

 

Enter type of unused objects to purge [Blocks/DEtailviewstyles/Dimstyles/Groups/LAyers/LTypes/MAterials/MUltileaderstyles/Plotstyles/SHapes/textSTyles/Mlinestyles/SEctionviewstyles/Tablestyles/Visualstyles/Regapps/Zero-length geometry/Empty text objects/Orphaned data/All]:

 

Command: a
Unknown command "A". Press F1 for help.


Command:
-PURGE

 

Enter type of unused objects to purge [Blocks/DEtailviewstyles/Dimstyles/Groups/LAyers/LTypes/MAterials/MUltileaderstyles/Plotstyles/SHapes/textSTyles/Mlinestyles/SEctionviewstyles/Tablestyles/Visualstyles/Regapps/Zero-length geometry/Empty text objects/Orphaned data/All]: n


Invalid option keyword.

Enter type of unused objects to purge [Blocks/DEtailviewstyles/Dimstyles/Groups/LAyers/LTypes/MAterials/MUltileaderstyles/Plotstyles/SHapes/textSTyles/Mlinestyles/SEctionviewstyles/Tablestyles/Visualstyles/Regapps/Zero-length geometry/Empty text objects/Orphaned data/All]:*Cancel*

 

Command: *Cancel*

 

This is what eventually worked:

^C^C-purge;r;;n;-purge;a;;n

 

Thanks for replying. 

This is my work ID, since now your ID is associated with your software.
My other ID is Julesagainn.
AutoCAD user since 1988.
0 Likes
Message 6 of 7

julie.walker2
Enthusiast
Enthusiast

That's what I'm trying to edit, the custom command macro.

This is my work ID, since now your ID is associated with your software.
My other ID is Julesagainn.
AutoCAD user since 1988.
0 Likes
Message 7 of 7

SeeMSixty7
Advisor
Advisor

@julie.walker2 wrote:

That's what I'm trying to edit, the custom command macro.


Yes, but I was suggesting you could try and delete the custom command macro from the CUI file and create a new one. Or just create a new one and test it to see if it works. 

But... I thought about it a bit more and thought what if you had an ENTER that you didn't know about.

Click the elipses ... next to the Macro. See if there is an extra [Enter] in the box. It will not show but if you hit the down arrow key and your cursor moves down to a new line, then there is your extra [enter] just back space up from that line and you should be good.

 

CustomCommandMacro.JPG

0 Likes