I have a custom macro that I use to set the proper draw order of a standard set of layers in each of my drawings. About half the time, this macro will crash AutoCAD. Every drawing has the same set of layers, so I am at a loss as to what could be setting off the crash occasionally.
I've posted the macro here and would appreciate any assistance in debugging.
^C^Cexpert;1;;^C^C-La;A;d;temp;s;temp;;;;GRAPHSCR;-layer;thaw;"l-hardscape-hatch";;-layer;set;l-hardscape-hatch;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-water;set;l-water;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-mulch;set;l-mulch;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-features-hatch;set;l-features-hatch;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-fines;set;l-fines;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-lawn;set;l-lawn;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-stone;set;l-stone;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;-render;set;-render;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;-calcs;set;-calcs;freeze;*;;_select;_auto;all;;draworder;previous;;back;-la;thaw;l-pl-groundcover;set;l-pl-groundcover;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-groundcover-e;set;l-pl-groundcover-e;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-furniture;set;l-furniture;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-features;set;l-features;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-shrubs;set;l-pl-shrubs;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-label;set;l-pl-label;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-shrubs-e-shade;set;l-pl-shrubs-e-shade;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-shrubs-e;set;l-pl-shrubs-e;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-trees;set;l-pl-trees;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-trees-e-shade;set;l-pl-trees-e-shade;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;thaw;l-pl-trees-e;set;l-pl-trees-e;freeze;*;;_select;_auto;all;;draworder;previous;;front;-la;a;r;temp;;;re;
Hi Maxim,
The macro completely crashes AutoCAD. The files have a lot of custom blocks for my company so I'd rather not post it publicly. I could possibly send you a stripped down file if that would be helpful, let me know.
Hi Maxim,
Ok, thanks for the info. For now I'd rather not post the drawing publicly and understand stripping down the drawing might not reproduce the crash.
Could I send it to you personally? Or could you give me some things I might look for in the drawing first before sending over?
I just emailed you a file that has crashed using the macro above. Let me know if you did not receive it for any reason.
Hi Maxim,
Yes, I use the file as a template base file, copying and pasting it to a new folder to begin a new project.
For clarity, I am using AutoCAD LT 2017 for Mac if that matters. I would get the same crash on occasion using AutoCAD LT 2016 for Mac as well.
Hi Maxim,
I'm not 100% sure, but I'm pretty sure I've never seen a Custom Error Report window after the crash.
To be really specific about what happens:
I've added the macro as a menu item under the Customize Interface Dialog, so I click on the menu and then the menu item containing the macro. Most of the time (maybe 60%) it works perfectly. Sometimes it workes perfectly, however the command line pops up when the macro has finished (which I usually keep hidden). And sometimes AutoCAD crashes by simply vanishing from the screen.
Let me know if I can provide any other details for you. Thanks Maxim for your time 🙂
Just ran the macro to get you some additional info. See below:
1 - Using a freshly opened file, I got the command line to pop-up on the first try. See below for the contents of the command line.
2 - When AutoCAD crashes it completely closes, I have to restart and go through the welcome screen and drawing recovery dialog to get going again. I also get the below recovery dialog on crash.
3 - I have not tried this option.
Dialog appears on crash:
Command line contents after a successful run of macro (commandline pops up where it was previously hidden):
Command: draworder Select objects: previous 7 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: back Command: -la -LAYER Current layer: "-CALCS" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-groundcover Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-groundcover Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-GROUNDCOVER". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 12 found Select objects: Command: draworder Select objects: previous 12 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-GROUNDCOVER" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-groundcover-e Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-groundcover-e Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-GROUNDCOVER-E". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 2 found Select objects: Command: draworder Select objects: previous 2 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-GROUNDCOVER-E" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-furniture Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-furniture Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-FURNITURE". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 23 found Select objects: Command: draworder Select objects: previous 23 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-FURNITURE" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-features Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-features Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-FEATURES". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 53 found Select objects: Command: draworder Select objects: previous 53 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-FEATURES" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-shrubs Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-shrubs Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-SHRUBS". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 95 found Select objects: Command: draworder Select objects: previous 95 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-SHRUBS" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-label Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-label Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-LABEL". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 96 found Select objects: Command: draworder Select objects: previous 96 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-LABEL" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-shrubs-e-shade Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-shrubs-e-shade Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-SHRUBS-E-SHADE". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 1 found Select objects: Command: draworder Select objects: previous 1 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-SHRUBS-E-SHADE" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-shrubs-e Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-shrubs-e Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-SHRUBS-E". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 1 found Select objects: Command: draworder Select objects: previous 1 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-SHRUBS-E" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-trees Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-trees Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-TREES". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 26 found Select objects: Command: draworder Select objects: previous 26 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-TREES" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-trees-e-shade Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-trees-e-shade Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-TREES-E-SHADE". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 1 found Select objects: Command: draworder Select objects: previous 1 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-TREES-E-SHADE" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: thaw Enter name list of layer(s) to thaw: l-pl-trees-e Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: l-pl-trees-e Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "L-PL-TREES-E". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Command: _select Select objects: _auto Select objects: all 3 found Select objects: Command: draworder Select objects: previous 3 found Select objects: Enter object ordering option [Above objects/Under objects/Front/Back] <Back>: front Command: -la -LAYER Current layer: "L-PL-TREES-E" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: a Enter an option [?/Save/Restore/Edit/Name/Delete/Import/EXport]: r Enter name of layer state to restore or [?]: temp Enter an option [?/Save/Restore/Edit/Name/Delete/Import/EXport]: Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: Regenerating model. Command: re REGEN Regenerating model. Command:
Hi Maxim,
I added the macro to the Tool Sets panel, and was able to get the crash to occur on occasion. Does not appear to help.
Any way for me to grab the Command Line text during a crash?
You can try to enable drawing log and look at it after AutoCAD crash.
Here is how-to:
1/ at first, in order to be able to find drawing logs, which will be created for each file separately, you need to change "log file location" path in Application tab of AutoCAD preferences:
Set it to some specific folder you can easily find.
2/ Turn log file ON with LOGFILEON command. Now log file with all command line history will be created for each drawing session.
After AutoCAD will crash, you will be able to find log file for the last opened drawing where the crash occurred.
To avoid clogging the disk with unnecessary garbage - don't forget to turn log file off with LOGFILEOFF command after you will finish with investigation. You can also safely delete log files anytime.
Maxim
Hi Maxim,
I just followed your steps for enabling the log file and got the crash to occur again. See below for the contents of the log file, let me know if I should attach it for some reason.
[ AutoCAD LT - Mon Apr 10 11:39:39 2017 ]---------------------------------------- Opening an AutoCAD LT 2013/AutoCAD 2013 format file. Substituting [simplex.shx] for [archquik.shx]. Regenerating model. Command: Autodesk DWG. This file is a TrustedDWG last saved by an Autodesk application or Autodesk licensed application. Command: Command: Command: Command: Command: expert Enter new value for EXPERT <1>: 1 Command: EXPERT Enter new value for EXPERT <1>: *Cancel* Command: Command: -La -LAYER Current layer: "0" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: A Enter an option [?/Save/Restore/Edit/Name/Delete/Import/EXport]: d Enter name of layer state to delete or [?]: temp Enter an option [?/Save/Restore/Edit/Name/Delete/Import/EXport]: s Enter new layer state name: temp