0% found this document useful (0 votes)
67 views4 pages

Script Writing

writing

Uploaded by

sharkman2020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views4 pages

Script Writing

writing

Uploaded by

sharkman2020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

WPMidas00146 June2011

GuidebyMilesNicholson

ScriptWriting

AllAutoCADElectricalUsers

Ascriptdoesonethingandonethingonly:itmimicswhatistypedatthekeyboard.Anythingyouenterin
AutoCADthatshowsupontheCommand:linepromptcanbeputintoascriptfile.

AutoCADandthereforeAutoCADElectricalcanrunthemajorityofitscommandsfromtheCommandlinewithout
therequirementofpopupdialogueboxes.Thismeansthatmultiplecommandscanbegroupedtogetherin
whatisknownasascriptonanindividualdrawing,selecteddrawingsoranentireproject.
AnexamplemaybesimplythatyouwanttoperformaZoomExtents,aPurgeandanAudit.Thisinnormal
AutoCADcommandscouldtakedaysonseveralhundreddrawings!

Amajorpartofwritingscriptsistounderstandhowacommandoperatesandwhatkeyinputsmovethe
commandtothenextstage.EventypingZ(forzoom)atthecommandpromptwillgiveseveraloptionssuchasW
(window),E(extents),D(dynamic)etc
MostAutoCADandAutoCADElectricalcommandshavedialogueswhichbasicallymeanapopupboxappears
whenthecommandisinitiatedyetthemajorityofcommandscanhavetheirpopupdialoguesturnedoff.
AutoCADitselfhasvariablesthatturnoffthemajorityoffileandcommanddialogues

TypeFILEDIAatthecommandpromptandsetto0toturnofffiledialogueboxes(Open&Savecmds)
o Type1toreenable

TypeCMDDIAatthecommandpromptandsetto0toturnoffcommanddialogueboxes
o Type1toreenable

Furthermore,dependingonAutoCADversion,acommandmayhaveitsdialogueboxturnedoffbytypinga
oran_(dependingoncommandandversionofAutoCAD)proceedingthecommandnamee.gPURGE=
PURGE=_PURGE.

BecauseAutoCADElectricalisprojectbasedconsistingofmultipledrawingswithinaproject,theadvantageof
beingabletorunscriptshasafargreaterbenefitthannormalgenericAutoCADandcanautomateyourdesign
processfarinexcessofotherCADrequirements/departmentssuchasyourmechanicalcounterparts.

Letssayinthisexampleweneedtodothefollowing:

MakeLayer0current
PerformZoomExtents
PerformanAudittofixanypotentialerrors
PerformaPurgeBlocks

TrytypingeachcommandattheCommand:linetogetusedtohowtodefinecorrectly

ThenormalcommandforlayersisLAYER
Howeverifwenowproceedthecommandwitha.Thesignifiesacarriagereturn.

LAYER

YouarethenshownaseriesofoptionsontheCommand:line.Lookingatthecapitallettersofeachoption,you
haveasanexampleM=Make,S=Set,F=FreezeetcsothenextoptionwouldbeSET

GivingthecommandoptionofEnterlayernametomakecurrent.Entering0willmake0thecurrentlayer

Andfinallytofinishthecommandoffwenowneedtoenteranadditionalcarriagereturn

Sotheentirecommandis:

LAYER
S
0

WecannowmoveontoZoomExtents

Z
E

HowevertheZoomcommandisoneofonlyafewcommandswithinAutoCADthatdonotfollownormal
convention.YoucantypeZatthecommandpromptbutyoucanttypeZwithinascriptasitwillhaltthescript
statingthatZisanunrecognisedcommand.InthisinstancewehavetotypethefullcommandZOOM

ZOOM
E

...andthenAudit

AUDIT
Y

...andthenPurge

PURGE
B
*
N

Puttingallthecommandstogetherwenowhaveascriptof:

LAYER
S
0

ZOOM
E
AUDIT
Y
PURGE
B
*
N

Runningthescriptonyourproject(N.B.Youmustbeinoneofyourcurrentactiveprojectsdrawings)

FromtheProjectribbontab,select Utilities

SelectRuncommandscriptfile

Select

RightclickonanyexistingscriptandselectCopy

RightclickandPastethecopyintothesamedirectorylocation

RightclickoverthecopiedfileandRenametoadifferentnamee.g.CLEANUP

RightclickoverthefiletoOpeninNotepad

Removeanyexistingtextandreplacewiththescriptdefinedabove(therepresentsacarriagereturnONLY)

SelectFile>Save

CloseNotepad

Highlightthescriptfromtheavailableonesandselect

Select

SelectProject

Select

Select

Select

Obviouslyascriptcanbefarmorecomplexthantheabovewhereyoumayevencreatewiresandinsertsymbols!
AutoCADElectricalalsohasafullAPI(advancedprogramminginterface)whichisdefinedintheElectricalHelp

Happyscriptwriting

You might also like