Back in 2012, AutoCAD introduced a new feature called AutoCAD Core Console. Basically, it is a stripped-down version of AutoCAD from the UI perspective that can be executed from a Command Prompt. It has almost all the capabilities of the full version with the ability to load applications, execute lisp scripts or run simple AutoCAD commands. It is perfect if you need to automate a repetitive task and for batch operations.
Let’s say you need to purge a couple of .dwg files or detach all their external references before you want to send them out to a client. You would probably open every file one by one and execute those commands manually. Depending on the quantity and size of the files, it will not only be a tedious task but also potentially bind up AutoCAD on your machine for quite some time. In contrast, it takes only a couple of seconds to setup AutoCAD Core Console to run the same commands and let the computer do all the work.
The files in this repository are meant to help you get started creating simple batch operations. The scripts included are basic AutoCAD commands which can be easily modified and expanded.
-
Drop all the .dwg files you want to modify into the root folder next to the
RUN-SCRIPTS.bat
file. -
Open the
RUN-SCRIPTS.bat
file in a text editor like Notepad. In the file you will see the following code:
FOR %%f IN ("%~dp0*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" /i "%%f" /s "%~dp0scripts\script-name.scr" /l en-US
- To make the code work you will need to:
-
Check that the path to the AutoCAD Core Console (
accoreconsole.exe
) which in my case can be found atC:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe
is correct. -
Replace the
script-name.scr
for the script you want to use.
-
Save and close the
RUN-SCRIPTS.BAT
file. -
Double click on
RUN-SCRIPTS.BAT
to execute.
- Use the purge script on all the files in the current folder:
FOR %%f IN ("%~dp0*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" /i "%%f" /s "%~dp0scripts\purge.scr" /l en-US
- Use the audit script on all the files in the current folder:
FOR %%f IN ("%~dp0*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" /i "%%f" /s "%~dp0scripts\audit.scr" /l en-US
- If you want to run more than one script just copy the current line of code into a new line and add the script you want to execute after the first one. For example, if you want to audit the files, purge them and detach all the external references you would end with the following:
FOR %%f IN ("%~dp0*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" /i "%%f" /s "%~dp0scripts\audit.scr" /l en-US
FOR %%f IN ("%~dp0*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" /i "%%f" /s "%~dp0scripts\purge.scr" /l en-US
FOR %%f IN ("%~dp0*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2017\accoreconsole.exe" /i "%%f" /s "%~dp0scripts\detach.scr" /l en-US
- Audit File -> scripts/audit.scr
- Detach External References -> scripts/detach.scr
- All Layers On -> scripts/layon.scr
- All Layer Thawn -> scripts/laythw.scr
- Move All Elements -> scripts/move.scr
- Purge File -> scripts/purge.scr
- Set UCS World -> scripts/ucs_world.scr
- Unlock All Layers -> scripts/unlock_all.scr
- Zoom Extends -> scripts/zoom_extends.scr
? +CONSTRAINTSETTINGS +PUBLISH +SAVEAS +UCSMAN +VPORTS 3DALIGN 3DCLIP -3DCONFIG 3DCONFIG 3DCORBIT 3DDISTANCE 3DDWF 3DDWFPUBLISH 3DEDITBAR 3DFACE 3DFLY 3DFORBIT 3DMESH 3DMOVE 3DORBIT 3DORBITCTR 3DORBITTRANSPARENT -3DOSNAP 3DOSNAP 3DPAN 3DPAN2 3DPANTRANSPARENT 3DPOLY 3DROTATE 3DSCALE 3DSWIVEL 3DSWIVELTRANSPARENT 3DWALK 3DZOOM 3DZOOM2 3DZOOMTRANSPARENT ABOUT ACADWBLOCKDIALOG ACGZDRAGACTION ACISIN ACISOUT ACTMDRAGACTION ACUCSEDITACTION ADDSELECTED AECDISPLAYMANAGERCONFIGSSELECTION -AECDWGUNITS -AECEXPORTTOAUTOCAD AECFILEOPENMESSAGE AECFILESAVEMESSAGE AECOBJECTCOPYMESSAGE AECOBJRELDUMP AECOBJRELSHOW AECOBJRELUPDATE AECPOSTDXFINFIX AECSETXREFCONFIG AECVERSION AI_EMPTYPRINC AI_MOLC AI_VIEWPORTS_ALERT AIDIMFLIPARROW AIDIMPREC AIDIMSTYLE AIDIMTEXTMOVE AIMLEADEREDITADD AIMLEADEREDITREMOVE AIOBJECTSCALEADD AIOBJECTSCALEREMOVE ALIGN ALLPLAY AMECONVERT ANNORESET ANNOUPDATE APERTURE ARC AREA -ARRAY ARRAY -ARRAYCLOSE ARRAYCLOSE ARRAYEDIT ARRAYPATH ARRAYPOLAR ARRAYRECT ARX -ATTDEF ATTDEF ATTDISP -ATTEDIT ATTEDIT -ATTEXT ATTEXT AUDIT AUTOCOMPLETE AUTOCONSTRAIN AUTOPUBLISH BASE -BHATCH BHATCH BLEND -BLOCK BLOCK BLOOKUPTABLE BMAKE BMOD BMPOUT -BOUNDARY BOUNDARY BOX BPOLY BREAK BREP CAL CELLSELECT CHAMFER CHAMFEREDGE CHANGE CHPROP CIRCLE CLASSICGROUP CLASSICXREF CLEANSCREENOFF CLEANSCREENON CLIP CLOSEALL -COLOR COLOR COMPILE CONE CONSTRAINTBAR CONSTRAINTSETTINGS CONVERT CONVERTPOLY CONVTONURBS CONVTOSOLID CONVTOSURFACE COPY COPYBASE COPYCLIP COPYHIST COPYLINK -COPYTOLAYER COPYTOLAYER CUTCLIP CVADD CVHIDE -CVREBUILD CVREBUILD CVREMOVE CVSHOW CYLINDER -DATAEXTRACTION DATAEXTRACTION DATALINK DATALINKUPDATE DBLIST DCALIGNED DCANGULAR DCCONVERT DCDIAMETER DCDISPLAY DCFORM DCHORIZONTAL DCLINEAR DCRADIUS DCVERTICAL DDEDIT DELAY DELCONSTRAINT DGNADJUST DGNLAYERS DIM DIM1 DIMALIGNED DIMANGULAR DIMARC DIMBASELINE DIMBREAK DIMCENTER DIMCONSTRAINT DIMCONTINUE DIMDIAMETER DIMDISASSOCIATE DIMEDIT DIMHORIZONTAL -DIMINSPECT DIMINSPECT DIMJOGGED DIMJOGLINE DIMLINEAR DIMORDINATE DIMOVERRIDE DIMRADIUS DIMREASSOCIATE DIMREGEN DIMROTATED DIMSPACE -DIMSTYLE DIMSTYLE DIMTEDIT DIMVERTICAL DIST DISTANTLIGHT DIVIDE DONUT DOUGHNUT DRAGMODE DRAWORDER DROPGEOM DTEXT DUMPCMDS DVIEW -DWFADJUST DWFADJUST -DWFATTACH DWFATTACH DWFCLIP DWFFORMAT DWFLAYERS DXBIN DXFIN DXFOUT -EATTEXT EATTEXT EDGESURF EDITTABLECELL ELEV ELLIPSE END EPLOTEXT ERASE EXPLODE -EXPORT EXPORT EXPORTDWF EXPORTDWFX EXPORTPDF EXPORTSETTINGS EXTEND EXTRUDE FILEOPEN FILL FILLET FILLETEDGE FLATSHOT FREESPOT FREEWEB GCCOINCIDENT GCCOLLINEAR GCCONCENTRIC GCEQUAL GCFIX GCHORIZONTAL GCPARALLEL GCPERPENDICULAR GCSMOOTH GCSYMMETRIC GCTANGENT GCVERTICAL GEOMCONSTRAINT GRADIENT -GRAPHICSCONFIG GRAPHICSCONFIG GRAPHSCR GRID -GROUP GROUP GROUPEDIT -HATCH HATCH -HATCHEDIT HATCHEDIT HATCHGENERATEBOUNDARY HATCHSETBOUNDARY HATCHSETORIGIN HATCHTOBACK HELIX HELP HIDE HIDEOBJECTS ID -IMAGE -IMAGEADJUST IMAGECLIP IMAGEQUALITY IMPLIEDFACEX IMPORT IMPRINT -INSERT INSERT -INTERFERE INTERFERE INTERSECT ISOLATEOBJECTS ISOPLANE JOIN JPGOUT JUSTIFYTEXT LAYCUR -LAYDEL LAYDEL -LAYER LAYERCLOSE LAYERP LAYERPMODE LAYFRZ LAYISO LAYLCK -LAYMCH LAYMCH LAYMCUR -LAYMRG LAYMRG LAYOFF LAYON -LAYOUT LAYOUT LAYTHW LAYULK LAYUNISO LAYVPI LEADER LENGTHEN LIGHT LIMITS LINE -LINETYPE LINETYPE LIST LIVESECTION LOAD LOFT LOGFILEOFF LOGFILEON LTSCALE -LWEIGHT LWEIGHT MASSPROP MATCHCELL MEASURE MEASUREGEOM MESH MESHCAP MESHCOLLAPSE MESHCREASE MESHEXTRUDE MESHMERGE MESHOPTIONS MESHPRIMITIVEOPTIONS MESHREFINE MESHSMOOTH MESHSMOOTHLESS MESHSMOOTHMORE MESHSPIN MESHSPLIT MESHUNCREASE MINSERT MIRROR MIRROR3D MLEADER MLEADERALIGN MLEADERCOLLECT MLEADERCONTENTEDIT MLEADEREDIT MLINE MODEL MOVE MREDO MTEDIT -MTEXT MTEXT MTPROP MULTIPLE NAVBAR NAVVCUBE NCOPY NETLOAD NEW -OBJECTSCALE OFFSET OOPS OPEN OPTCHPROP ORTHO -OSNAP OSNAP -OVERKILL PAGESETUP -PAN -PARAMETERS PARAMETERS PARAMETERSCLOSE -PARTIALOAD PARTIALOAD -PARTIALOPEN PASTEBLOCK PASTEORIG PEDIT PFACE PLAN PLANESURF PLINE -PLOT PLOT -PLOTSTAMP -PLOTSTYLE PNGOUT POINT POINTLIGHT POLYGON POLYSOLID PRESSPULL PREVIEW PROJECTGEOMETRY -PSETUPIN PSETUPIN PSFILL PSOUT PSPACE -PUBLISH PUBLISH -PURGE PURGE PYRAMID QDIM QLEADER QNEW QSAVE QTEXT RAY RECOVER RECTANG RECTANGLE REDO REDRAW REDRAWALL REGEN REGEN3 REGENALL REGENAUTO REGION -RENAME RENAME RESETBLOCK RESUME REVCLOUD REVERSE REVOLVE REVSURF ROTATE ROTATE3D RULESURF SAVE SAVEAS SCALE -SCALELISTEDIT SCALETEXT SCRIPT SECTION SECTIONPLANE SECTIONPLANEJOG SECTIONPLANESETTINGS SECTIONPLANETOBLOCK SELECT SELECTSIMILAR SEQUENCEPLAY SETBYLAYER SETVAR -SHADE SHADE -SHADEMODE SHADEMODE SHAPE SKETCH SLICE SNAP SOLDRAW SOLID SOLIDEDIT SOLPROF SOLVIEW SPACEMOUSEACTION SPACETRANS SPHERE SPLINE SPLINEDIT SPOTLIGHT STLOUT STRETCH -STYLE STYLE SUBTRACT SURFBLEND SURFEXTEND SURFEXTRACTCURVE SURFFILLET SURFNETWORK SURFOFFSET SURFPATCH SURFSCULPT SURFTRIM SURFUNTRIM SWEEP -TABLE TABLE TABLEDIT TABLEEXPORT TABLESTYLE TABLET TABSURF TARGETPOINT -TEXT TEXT TEXTEDIT TEXTSCR TEXTTOFRONT THICKEN TIFOUT TIME TINSERT TOLERANCE TORUS TRACE TRANSPARENCY TRIM U UCS UCSICON UCSMAN UNDEFINE UNDO UNGROUP UNION UNISOLATEOBJECTS -UNITS UNITS UPDATETHUMBSNOW -VIEW VIEWBACK VIEWCUBEACTION VIEWFORWARD VIEWGO VIEWPLAY VIEWPLOTDETAILS VIEWPORTS VIEWRES -VISUALSTYLES VPCLIP VPLAYER VPMAX VPMIN -VPORTS VPORTS VSCURRENT VSSAVE WALKFLYSETTINGS -WBLOCK WBLOCK WEBLIGHT WEDGE WHOHAS WIPEOUT WMFIN WMFOUT -XBIND XBIND XCLIP XEDGES XLINE XOPEN -XREF XREF ZOOM