YZ Posted September 5, 2011 Share Posted September 5, 2011 I have a macro that finishes with a RENAME Dialog Box. Originally I wanted to loop it twice, but as soon as I added the second RENAME it supressed the first one to the Command Line. See below, it simply adds the text "RENAME" as the object type to rename: Command: _RENAMEEnter object type to rename [block/Dimstyle/LAyer/LType/Material/multileadeRstyle/Style/Tablestyle/Ucs/VIew/ VPort]: RENAME I need to add more commands to the end of this macro, but it falls over as soon as there is anything after the 1st RENAME command. Here is that part of the Macro that works for a single instance of the Dialog Box: ^C^C_RENAME But as soon as I attempt to add something, it goes to command line instead: ^C^C_RENAME;RENAME Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 8, 2011 Share Posted September 8, 2011 What are you trying to accomplish? I see no reason to open the dialog box twice. You need to make appropriate responses to the first command. Quote Link to comment Share on other sites More sharing options...
alanjt Posted September 8, 2011 Share Posted September 8, 2011 Must. Provide. More. Information. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 8, 2011 Share Posted September 8, 2011 Maybe he wants to rename the RENAME command. LOL Quote Link to comment Share on other sites More sharing options...
alanjt Posted September 8, 2011 Share Posted September 8, 2011 Maybe he wants to rename the RENAME command. LOL LoL, then he should use the REDEFINE command. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 11, 2011 Share Posted September 11, 2011 Try: ^C^C_RENAME;\;RENAME To add a pause. Quote Link to comment Share on other sites More sharing options...
YZ Posted September 11, 2011 Author Share Posted September 11, 2011 What are you trying to accomplish? I see no reason to open the dialog box twice. You need to make appropriate responses to the first command. When we import survey files from 3rd party software into dwg they always have Suffixes on the blocks and layers that we need to remove. So we use the first RENAME command to rename all the blocks, and the second for the layers. Everytime I wish that the "*" would work in the command line, but it only works in the Dialog Box, which is the only reason we use Dialog. Otherwise we could write it into the macro and would not need any user input. Originally Posted by ReMark Maybe he wants to rename the RENAME command. LOL LoL, then he should use the REDEFINE command. I see the confusion. (Is REDEFINE a real command? It is not in LT.) We need 2 instances of the dialog box to pop up separately, not a RENAME within a RENAME! Lee Mac Try: Code: ^C^C_RENAME;\;RENAME To add a pause. Whenever I try to pause for user input it suppress RENAME to the command line. So I end up with something like this:RENAME Enter object type to rename[block/Dimstyle/LAyer/LType/Material/multileadeRstyle/Style/Tablestyle/Ucs/VIew/ VPort]: RENAME Invalid option keyword. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 12, 2011 Share Posted September 12, 2011 ... So complete the command at the comand line, and simply include a "\" to pause for user input where necessary? Quote Link to comment Share on other sites More sharing options...
YZ Posted September 12, 2011 Author Share Posted September 12, 2011 ... So complete the command at the comand line, and simply include a "\" to pause for user input where necessary? I agree and would prefer to use the command line. However there can be anywhere up to 15 blocks and 80 layers, with a variable list depending on each project. We use a "*" to select all the blocks to be renamed, for example: Rename: CAD_SYMBOL_* To: * The * works in the dialog box, but returns "Unknown Block Name" when used in the Command Line. That is the only reason I am persisting with 2 dialog box commands. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 12, 2011 Share Posted September 12, 2011 Do it the old fashioned way and drop down into a DOS command line and do all your renaming there using a batch file and wildcards. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 12, 2011 Share Posted September 12, 2011 That *should* not be necessary; to use the command line version of the RENAME command, use -RENAME instead (note the preceding hyphen "-"). As I understand it, anything that can be done using the dialog can be done programmatically via the command line version as well. Perhaps you (YZ) could post a more complete version of your command line code, so that we may better suggest how to accomplish this task? Quote Link to comment Share on other sites More sharing options...
YZ Posted October 6, 2011 Author Share Posted October 6, 2011 Sorry for the delay, I've been run off my feet until today. Sweet breathing space. To process dwg files from third party software I always do the following macro: Z;E;^C^C-UNITS;2;3;2;5;90;Y;'graphscr;^C^C-layer LO *CONTOURS F *TRIANGLES LO _CONTOUR* LO TITLE ;_ai_selall SETBYLAYER Y N -layer U *CONTOURS U _CONTOUR* U TITLE ;^C^C_qselect _erase;-PURGE;A;*;N;^C^C_RENAME I want to add more to the macro, but the rename fails as soon as I add anything else into the macro afterward. I can work around it by having a second button macro, but I cannot understand why it will not work. That *should* not be necessary; to use the command line version of the RENAME command, use -RENAME instead (note the preceding hyphen "-"). As I understand it, anything that can be done using the dialog can be done programmatically via the command line version as well. Perhaps you (YZ) could post a more complete version of your command line code, so that we may better suggest how to accomplish this task? RenderMan, I would much prefer to use "-rename" but the wildcard does not work in the command line. Anyone is welcome to try it, I have posted about that quirk previously and have even made a business case to Autodesk development team. Do it the old fashioned way and drop down into a DOS command line and do all your renaming there using a batch file and wildcards. ReMark, I had never thought of that. I will check it out. But from memory a batch file can call on AutoCAD scripts, which would presumably run into the same wildcard dilemma? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.