0% found this document useful (0 votes)
16 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)
16 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

WPMidas00146 June2011

GuidebyMilesNicholson

ScriptWriting

AllAutoCADElectricalUsers

Ascriptdoesonethingandonethingonly:[Link]
AutoCADthatshowsupontheCommand:linepromptcanbeputintoascriptfile.

AutoCADandthereforeAutoCADElectricalcanrunthemajorityofitscommandsfromtheCommandlinewithout
[Link]
whatisknownasascriptonanindividualdrawing,selecteddrawingsoranentireproject.
AnexamplemaybesimplythatyouwanttoperformaZoomExtents,[Link]
AutoCADcommandscouldtakedaysonseveralhundreddrawings!

Amajorpartofwritingscriptsistounderstandhowacommandoperatesandwhatkeyinputsmovethe
[Link](forzoom)atthecommandpromptwillgiveseveraloptionssuchasW
(window),E(extents),D(dynamic)etc
MostAutoCADandAutoCADElectricalcommandshavedialogueswhichbasicallymeanapopupboxappears
whenthecommandisinitiatedyetthemajorityofcommandscanhavetheirpopupdialoguesturnedoff.
AutoCADitselfhasvariablesthatturnoffthemajorityoffileandcommanddialogues

TypeFILEDIAatthecommandpromptandsetto0toturnofffiledialogueboxes(Open&Savecmds)
o Type1toreenable

TypeCMDDIAatthecommandpromptandsetto0toturnoffcommanddialogueboxes
o Type1toreenable

Furthermore,dependingonAutoCADversion,acommandmayhaveitsdialogueboxturnedoffbytypinga
oran_(dependingoncommandandversionofAutoCAD)[Link]=
PURGE=_PURGE.

BecauseAutoCADElectricalisprojectbasedconsistingofmultipledrawingswithinaproject,theadvantageof
beingabletorunscriptshasafargreaterbenefitthannormalgenericAutoCADandcanautomateyourdesign
processfarinexcessofotherCADrequirements/departmentssuchasyourmechanicalcounterparts.

Letssayinthisexampleweneedtodothefollowing:

MakeLayer0current
PerformZoomExtents
PerformanAudittofixanypotentialerrors
PerformaPurgeBlocks

TrytypingeachcommandattheCommand:linetogetusedtohowtodefinecorrectly

ThenormalcommandforlayersisLAYER
[Link].

LAYER

YouarethenshownaseriesofoptionsontheCommand:[Link],you
haveasanexampleM=Make,S=Set,F=FreezeetcsothenextoptionwouldbeSET

GivingthecommandoptionofEnterlayernametomakecurrent.Entering0willmake0thecurrentlayer

Andfinallytofinishthecommandoffwenowneedtoenteranadditionalcarriagereturn

Sotheentirecommandis:

LAYER
S
0

WecannowmoveontoZoomExtents

Z
E

HowevertheZoomcommandisoneofonlyafewcommandswithinAutoCADthatdonotfollownormal
[Link]
[Link]

ZOOM
E

...andthenAudit

AUDIT
Y

...andthenPurge

PURGE
B
*
N

Puttingallthecommandstogetherwenowhaveascriptof:

LAYER
S
0

ZOOM
E
AUDIT
Y
PURGE
B
*
N

Runningthescriptonyourproject([Link])

FromtheProjectribbontab,select Utilities

SelectRuncommandscriptfile

Select

RightclickonanyexistingscriptandselectCopy

RightclickandPastethecopyintothesamedirectorylocation

[Link]

RightclickoverthefiletoOpeninNotepad

Removeanyexistingtextandreplacewiththescriptdefinedabove(therepresentsacarriagereturnONLY)

SelectFile>Save

CloseNotepad

Highlightthescriptfromtheavailableonesandselect

Select

SelectProject

Select

Select

Select

Obviouslyascriptcanbefarmorecomplexthantheabovewhereyoumayevencreatewiresandinsertsymbols!
AutoCADElectricalalsohasafullAPI(advancedprogramminginterface)whichisdefinedintheElectricalHelp

Happyscriptwriting

You might also like