+ All Categories
Home > Documents > CADKEY Advanced Design Language (CADL) Guide

CADKEY Advanced Design Language (CADL) Guide

Date post: 02-Mar-2018
Category:
Upload: rkdassust5091
View: 259 times
Download: 11 times
Share this document with a friend

of 231

Transcript
  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    1/231

    CADKEY Advanced Design Language (CADL) Guide

    CADL_MAN.DOC contains a description of programming features found in CADL, the CADKEYAdvanced Design Language.

    Table Of Contents CADL !eference Manua"

    Introduction............................................................................................................... 12CADL GUIDE FO!A".................................................................................................12#ection One$ %asics...................................................................................................1&

    U#I'G CADL............................................................................................................1&CADL EE##IO'#................................................................................................1&

    Integer Constants................................................................................................1&F*oat Constants................................................................................................... 1+#tring Constants..................................................................................................1+!at, O-erators...................................................................................................1+Logica* O-erators................................................................................................1%it/ise O-erators................................................................................................1O-eration E0a-*es............................................................................................1

    egister 3aria4*es...................................................................................................1CADL Data "5-es....................................................................................................26

    c,ar..................................................................................................................... 21dou4*e.................................................................................................................217oat.....................................................................................................................21int........................................................................................................................21*ong..................................................................................................................... 21s,ort....................................................................................................................21s*ist......................................................................................................................22string................................................................................................................... 22uc,ar...................................................................................................................22uint......................................................................................................................22u*ong................................................................................................................... 22us,ort.................................................................................................................. 22

    3aria4*e Dec*arations..............................................................................................28Data "5-ing.........................................................................................................28Dec*aring AAYs................................................................................................ 28Dec*aring #LI#"s..................................................................................................2&

    ",e CLEA coand..........................................................................................2+Forat #-eci9ers.................................................................................................2+In-ut Forat #-eci9ers.......................................................................................2Out-ut Forat #-eci9ers.....................................................................................2

    !at, Functions....................................................................................................... 86a4s (0).................................................................................................................86acos (0)................................................................................................................86asin (0)................................................................................................................ 86atan (0)................................................................................................................81atan2 (5: 0)..........................................................................................................81cei* (0)................................................................................................................. 81co-si;e (t5-e)......................................................................................................82cos (0)................................................................................................................. 82cos, (0)............................................................................................................... 82ds (d: : s).......................................................................................................88e0- (0)................................................................................................................. 887oor (0)................................................................................................................881??? CADKEY Cor-oration

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    2/231

    CADKEY Advanced Design Language (CADL) Guide

    *og (0)..................................................................................................................8=*og16 (0)..............................................................................................................8=-o/ (a: 4)............................................................................................................8&sin (0)..................................................................................................................8&sin, (0)................................................................................................................8&si;eo< (000)..........................................................................................................8+

    s@rt (0).................................................................................................................8+tan (0)..................................................................................................................8+tan, (0)................................................................................................................8

    OGA! CO'"OL #"A"E!E'"#.........................................................................8",e E! stateent.............................................................................................8",e IF stateent................................................................................................. 8%ranc,ing and Loo-ing /it, La4e*s.....................................................................8rogra %ranc,ing..............................................................................................8?E0iting a CADL -rogra......................................................................................8?#us-ending CADL E0ecution...............................................................................8?Ca**ing E0terna* rogras or #5ste rocesses..................................................8?Dec*aring t,e #ecurit5 Code #tring.....................................................................=6Co-i*er#-eci9c Contro* #tateents.................................................................=6

    #ection "/o$ Coands............................................................................................=1Introduction............................................................................................................=1Entit5 riitives.....................................................................................................=1

    ecognition o< Entit5 riitives...........................................................................=1Entit5 Contro*..........................................................................................................=2

    Dra/ing Entities..................................................................................................=2De*eting Entities..................................................................................................=2A*igning Ordinate Diensions.............................................................................=2Entit5 #e*ection...................................................................................................=8Entit5 Attri4utes..................................................................................................=8

    Dis-*a5 Contro*.......................................................................................................=8edra/ing 3ie/-orts...........................................................................................=8#ca*ing.................................................................................................................=8

    C*earing a 3ie/-ort.............................................................................................==#e*ecting Dis-*a5ed Leve*s..................................................................................==Leve* Descri-tors.................................................................................................==

    3ie/-ort Contro*.....................................................................................................=='ora*i;ed Device Coordinate #5ste...............................................................==3ie/-ort !ani-u*ation.........................................................................................==3ie/-ort In

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    3/231

    CADKEY Advanced Design Language (CADL) Guide

    Data Fi*e In-ut and Out-ut..................................................................................... =In-ut Coands.................................................................................................=Out-ut Coands..............................................................................................=C*osing a Fi*e....................................................................................................... =

    art and attern Fi*e Access....................................................................................=#aving: C*osing: and Loading art Fi*es..............................................................=

    art Fi*e Descri-tors.............................................................................................=#aving and Loading attern Fi*es.........................................................................=#etting #5ste 3a*ues............................................................................................=

    Co*or Gra-,ics a*ette.........................................................................................=Gra-,ics Cursor Location....................................................................................=?'ote "e0t Attri4utes.............................................................................................=?Leve*s Dis-*a5ed.................................................................................................=?

    #5ste araeters................................................................................................=?Director5 at,s....................................................................................................=?#5ste !asBs......................................................................................................=?Diension araeters........................................................................................=?Genera* #5ste araeters................................................................................&6

    #trings and Arra5s..................................................................................................&1

    Co-5ing an Arra5.................................................................................................&1#tring Functions...................................................................................................&13ector !at, Functions............................................................................................&1Co-ious Entities......................................................................................................&1

    Co-ious "5-es..................................................................................................... &2Co-ious Entities...................................................................................................&2Co-ious Data.......................................................................................................&2

    Co**ectives..............................................................................................................&8Creating A Co**ective...........................................................................................&8Adding Entities "o A Co**ective............................................................................&8eoving Entities Fro A Co**ective...................................................................&8Contro**ing Co**ective #e*ection...........................................................................&8

    Grou-s....................................................................................................................&8

    Creating a Grou-.................................................................................................&8Getting Grou- In

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    4/231

    CADKEY Advanced Design Language (CADL) Guide

    List %o0es............................................................................................................ &E0tracting List %o0 In

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    5/231

    CADKEY Advanced Design Language (CADL) Guide

    CO'IC..................................................................................................................... ?CEAD....................................................................................................................6CI"E...................................................................................................................1D%L#CL...................................................................................................................2DEFA"".................................................................................................................2DELCO...................................................................................................................8

    DELC"YE...............................................................................................................=DELE'"...................................................................................................................=dgadd4o0............................................................................................................ =dgadd4utton........................................................................................................&dgaddc,ecB.........................................................................................................&dgaddco4o....................................................................................................... +dgadd*ist............................................................................................................. dgaddnote...........................................................................................................dgaddradio..........................................................................................................dgaddte0tdou4*e...............................................................................................dgaddte0tint......................................................................................................?dgaddte0tstring.................................................................................................?dgaddtit*e............................................................................................................?6

    dgc,i*ddia*og.......................................................................................................?6dgde*co4o*istte0t.......................................................................................... ?1dgde*ent..............................................................................................................?1dgde**istte0t.......................................................................................................?1dgdra/dia*og......................................................................................................?2dgerasedia*og.....................................................................................................?2dg

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    6/231

    CADKEY Advanced Design Language (CADL) Guide

    dgsettit*e...........................................................................................................168DO#U%..................................................................................................................168DAE'"............................................................................................................. 16=EEC.....................................................................................................................16&EI"...................................................................................................................... 16+F'O"E...................................................................................................................16+

    GE'DI!................................................................................................................ 16GE"ALL.................................................................................................................111GE"COLO............................................................................................................111GE"CO................................................................................................................ 112GE"CU................................................................................................................118GE"E'"................................................................................................................ 11&GE"E'"ID............................................................................................................. 11+GE"E'"!..............................................................................................................11GE"E'"Y............................................................................................................ 11GE"FL".................................................................................................................. 126GE"GOU...........................................................................................................126GE"I'"..................................................................................................................121GE"KEY.................................................................................................................122

    GE"L"YE..............................................................................................................128GE"LID".......................................................................................................... 128GE"!E'U............................................................................................................. 12=GE"'E"..............................................................................................................12&GE"LA'E.............................................................................................................12+GE"O#................................................................................................................ 12GE"#".................................................................................................................12?GE"3IE..............................................................................................................186GO"O....................................................................................................................186GOU..................................................................................................................181ALF..................................................................................................................... 181IF.......................................................................................................................... 182I'U".................................................................................................................... 182

    I'C"YE............................................................................................................. 188I'"CODE.............................................................................................................188LA%EL...................................................................................................................188LEADE.................................................................................................................18&LE3EL#................................................................................................................. 18+LI'DI!.................................................................................................................. 18LI'E...................................................................................................................... 18!AKECOLL............................................................................................................18?!ODE....................................................................................................................18?'E"COLL.............................................................................................................1=6'F'O"E................................................................................................................ 1=6'LA%EL................................................................................................................. 1=1'LEADE..............................................................................................................1=2

    ''O"E.................................................................................................................. 1=2'O"E....................................................................................................................1=8'I"'E##............................................................................................................1=&O' GO"O..............................................................................................................1=&ODALIG'.............................................................................................................1=&ODDI!................................................................................................................ 1=+ALE""E................................................................................................................1=AU#E...................................................................................................................1=OI'"....................................................................................................................1=OLYGO'..............................................................................................................1=?

    >1??? CADKEY Cor-oration age +

    +

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    7/231

    CADKEY Advanced Design Language (CADL) Guide

    OLYLI'E............................................................................................................... 1&6A'GE................................................................................................................1&2I'"....................................................................................................................1&2O!"................................................................................................................1&8EAD....................................................................................................................1&8EADDE3..............................................................................................................1&=

    EDA...............................................................................................................1&&E!......................................................................................................................1&&E!COLL..............................................................................................................1&+#CALE................................................................................................................... 1&+#E".......................................................................................................................1&+

    #E" arrdir: dir....................................................................................................1E" arrst5*e: st5*e..............................................................................................1E" cd*-at,: -at,.............................................................................................. 1E" co**ect: ode..............................................................................................1E" co**se*: ode..............................................................................................1E" co*or: nu..................................................................................................1E" cona0es: ode...........................................................................................1&?#E" const: ode................................................................................................1&?

    #E" coord: ode...............................................................................................1&?#E" curtracB: ode...........................................................................................1&?#E" cvie/: nu.................................................................................................1&?#E" de-t,: va*................................................................................................... 1&?#E" devin:

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    8/231

    CADKEY Advanced Design Language (CADL) Guide

    #E" -en: nu....................................................................................................1++#E" -*t-at,: #E"J : -at,.................................................................................... 1++#E" -recision: nu............................................................................................1++#E" -rt-at,: -at,..............................................................................................1++#E" -tn-at,: -at,.............................................................................................1++#E" sna-: ode................................................................................................1++

    #E" sna-inc: 0inc: 5inc: H0a*ign: H5a*ign..........................................................1+#E" te0tas-: ratio..............................................................................................1+#E" unit: ode..................................................................................................1+#E" verse*: ode..............................................................................................1+#E" vie/ : nu: v-nu.....................................................................................1+#E" /itness: ode............................................................................................1+

    #E"A""................................................................................................................ 1+#E"CU.................................................................................................................1+?#E"'O"E..............................................................................................................1+?#LI'E.................................................................................................................. 16#I'"..................................................................................................................1s5saddv-............................................................................................................ 1s5sautov-...........................................................................................................1

    s5sde*v-..............................................................................................................1s5sgetnae.......................................................................................................1s5sin@t4si;e........................................................................................................1?s5sin@v-de

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    9/231

    CADKEY Advanced Design Language (CADL) Guide

    Co-i*er #-eci9c Coands...............................................................................261CO!!E'" #"I'G.............................................................................................261IF...EL#E IF...EL#E...............................................................................................261Loo- #tateents...............................................................................................262

    CO'"I'UE......................................................................................................262DOILE.....................................................................................................268

    EI"LOO........................................................................................................ 268FO................................................................................................................268ILE.............................................................................................................26=

    LOCAL................................................................................................................26=#I"C..............................................................................................................26&

    AE'DICE#............................................................................................................ 26+AE'DI I$ CADL Error !essages........................................................................26+

    Arg 'U! 4ad or issing.................................................................................26+Arra5 doesnMt atc, dec*aration ('A!E)..........................................................26+%ad arguent count..........................................................................................26+%ad CDE -rotot5-e (arg 'U!)........................................................................26+%ad diensions

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    10/231

    CADKEY Advanced Design Language (CADL) Guide

    #tring varia4*e M'A!EM not 1diensiona*.........................................................26?UnBno/n CALL DI!I'FO1.......................................................................................................216>DI!I'FO2.......................................................................................................212>E'"A""...........................................................................................................212>FL"DA"............................................................................................................ 218>I'"DA"............................................................................................................ 218>LDL'.............................................................................................................21=>!#CDA"..........................................................................................................21=>EFAC........................................................................................................... 21=>EFL'.............................................................................................................21&>EF'"...........................................................................................................21&

    >#"DA"........................................................................................................... 21&>""A""............................................................................................................ 21+>""I'FO......................................................................................................... 21+>I"L'.............................................................................................................21

    AE'DI III$ Entit5 In

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    11/231

    CADKEY Advanced Design Language (CADL) Guide

    Introduction

    #he CADKEY Advanced Design Language $CADL% is a po&erfu" programming "anguage thatoperates &ithin the structure of the CADKEY program. #he f"e'i(i"it) of this "anguage a""o&s )ou

    to design and store )our o&n functions and entities &ithin CADKEY, as &e"" as access theCADKEY data(ase.

    #he purpose of this section is to he"p )ou understand the (asic capa(i"ities of the CADL"anguage. #his CADL *uide is divided into the fo""o&ing sections+

    #his section, ntroduction to CADL, descri(es the various formats used throughout this guide.

    -ection One+ asics descri(es those e"ements &hich comprise a CADL program fi"e a"ong &ithan) e'isting restrictions on their use. #his inc"udes register varia("es, CADL data t)pes, varia("edec"arations, format specifiers, math functions and program contro" statements..

    -ection #&o+ Commands groups a"" of the commands into their re"ated categories and gives a

    (rief description of each of them.

    -ection #hree+ !eference is an a"pha(etic "isting of ever) CADL command, e'c"uding compi"erspecific commands.

    -ection /our+ CADL Compi"er e'p"ains the use of the CCOM0 uti"it) and "ists the commands anddirectives that are specific to compi"ed programs.

    #he Appendices "ist CADL error messages, information he"d in the s)stem arra)s, dia"og (o'errors, dia"og (o' entit) attri(utes, and inc"udes four samp"es programs.

    ______________________________________________________________________________

    CADL GUIDE FORMAT

    #he format used () the CADL guide fo""o&s these (asic ru"es+

    1 Commands (eginning &ith s)s_ or dg_ are casesensitive and must (e in "o&er case "etters, asthe) &i"" appear throughout the manua". #he rest of the commands are not casesensitive, (utfor c"arit), &i"" (e printed in upper case. /or e'amp"e+

    s)s_get_name

    A!C

    1 #hose parameters considered 2optiona"2 are enc"osed in s3uare (rac4ets for eas) reference.

    LAEL '5, )5, '6, )6, '7, )7, arro&t)pe, ', 8pen9

    1 An) section of te't that is in the fo""o&ing t)peface ma) (e ta4en direct") from (oo4 ande'ecuted. o"d te't in this t)peface represents onscreen te't resu"ts. /or e'amp"e,

    0A:-E 2#his can t)ped in direct")2

    >1??? CADKEY Cor-oration age 11

    11

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    12/231

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    13/231

    CADKEY Advanced Design Language (CADL) Guide

    _____________________________________________________________________________

    >1??? CADKEY Cor-oration age 18

    18

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    14/231

    CADKEY Advanced Design Language (CADL) Guide

    Section One: Basics

    USING CADL

    A CADL program fi"e ma) (e generated using a te't editor or &ord processing program under theru"es defined in this guide. Names for these fi"es fo""o& the same specifications as the s)stem=snaming convention, a"ong &ith the addition of an e'tension. -pecific e'tensions are discussed intheir respective sections of this guide.

    #o e'ecute a CADL fi"e in CADKEY or C:##N* ED*E, use the /LE-, CADL, E>EC:#Eoption. Enter the name of the CADL fi"e and press ?Enter@. f an error is detected, CADL fi"eprocessing ha"ts and an error message is disp"a)ed.

    /or a comp"ete "isting of these error messages and their descriptions, refer to Appendi' .

    A t)pica" CADL fi"e consists of varia("e "ength records de"imited () ne& "ines. Each of thesestatements directs the f"o& of the program. A t)pica" statement represents either a primitive,

    command or e'pression, a"ong &ith an) re3uired parameters. 0"ease refer to the !eferencesection of this guide for detai"ed information on primitives, program contro" statements andcommands.

    CADL EXPRESSIONS

    #he purpose of an e'pression is to eva"uate a mathematica" statement and optiona"") store theresu"ts in a varia("e. !efer to !egister aria("es, found in this section, for an e'p"anation of thedifferent t)pes of varia("es offered () the s)stem.

    /or e'amp"e+

    0ON# $6.Ba%, 7.B, $a1(%

    descri(es a 0ON# primitive &ith an ' va"ue assigned the resu"ts of 6 p"us the numeric va"ue ofa, a ) va"ue of 7, and a < va"ue assigned the resu"ts of a times (.

    Note that in a CADL program, an e'pression terminates at the end of a "ine un"ess a (ac4s"ash$;%is found. hen this is the case, the command is continued on the fo""o&ing "ine. /or e'amp"e+

    n s3rt$a1(%;sin$ang"e%161;$')

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    15/231

    CADKEY Advanced Design Language (CADL) Guide

    he'adecima" digits a"so inc"ude the characters af $upper or "o&er case% corresponding to theva"ues 5B 5J respective").

    /"oat Constants

    A f"oat constant consists of a signed integer part, a decima" point, a fractiona" part, an E $or e%,and a signed integer e'ponent. Either the integer part or the fractiona" part ma) (e omitted, (utnot (oth. Either the decima" point or the E $or e% &ith e'ponent ma) (e omitted, (ut not (oth.

    -tring Constants

    A string constant is a se3uence of characters enc"osed in 3uotes, such as 2this is a string2. A""strings are treated as an arra) of characters and are automatica"") terminated () the nu""character $A-C va"ue B%. #hus, the string 2he""o2 actua"") contains si' characters. A specia"character se3uence is provided to denote contro" characters and characters outside of the A-Crange. #he se3uence is signa"ed () a (ac4s"ash$;% character. hen detected, the ne't characteris interpreted as sho&n (e"o&. /or characters not "isted, the character itse"f is used. #his

    provides a &a) of entering characters &hich norma"") have a specia" meaning $e.g., use ;; for the; character, ;2 for 2, etc.%

    ;( (ac4space ;f formfeed;n ne&"ine ;r carriage return;t ta(

    n addition to the a(ove characters, an octa" va"ue ma) (e entered () fo""o&ing the ; character&ith a three digit octa" num(er $e.g., ;6I7%. A"so, a he'adecima" va"ue ma) (e entered ()fo""o&ing the ; character &ith the character ' and t&o he'adecima" digits $e.g., ;'GJ%. /or an octa"va"ue the permissi("e range is ;BBB ;7HH for a he'adecima" the range is ;'BB ;'ff.

    Most of the operators recogni1??? CADKEY Cor-oration age 1&

    1&

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    16/231

    CADKEY Advanced Design Language (CADL) Guide

    a5.J dou("e f"oating point assignment(5 integer $stored as dou("e% assignment

    Logica" Operators

    a ( e3ua" comparisona P ( not e3ua" comparisona @ ( greater than comparisona ? ( "ess than comparisona @ ( greater than or e3ua" to comparisona ? ( "ess than or e3ua" to comparisona QQ ( AND operationa RR ( O! operation$a% S ' + ) conditiona"

    it&ise Operators

    a R ( a O!ed &ith (a Q ( a ANDed &ith (a T ( a >O!ed &ith (1a @@ ( a shifted right () count of (a ?? ( a shifted "eft () count of (Ua comp"ement

    A"ge(raic operations are prioriti

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    17/231

    CADKEY Advanced Design Language (CADL) Guide

    Operation E'amp"es

    E'amp"e 5+

    -tatement+ ' V 5B 1 0 cos$VJ%!esu"t+ varia("e ' is assigned the va"ue 5.FI7HVV

    E'amp"e 6+

    -tatement+ ' $) 67 J% $< Wdepth%$&here Wdepth B%

    !esu"ts+ varia("e ' is assigned the va"ue V.Ivaria("e ) is assigned the va"ue V.Ivaria("e < is assigned the va"ue of s)stem varia("e Wdepth &hich, in this case, e3ua"s

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    18/231

    CADKEY Advanced Design Language (CADL) Guide

    Wco"or current co"or Wconst current s)stem status of 6D7D construction s&itchWcsi

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    19/231

    CADKEY Advanced Design Language (CADL) Guide

    Wptnname89 name of most recent") accessed pattern fi"enameWptnpath89 director) path of pattern fi"esWrefarc8989 arra) used () some CADL functions to return data for the reference arcWref"n8989 arra) used () some CADL functions to return data for the reference "ineWrefpnt8989 arra) used () some CADL functions to return data for the reference pointWsca"e current s)stem vie&ing sca"eWse"pva" parameter va"ue of mar4er position on se"ected entit)Wse"snum segment num(er of mar4er position on se"ected entit)Wsfpath89 director) path of scratch f i"esWstrdat89 arra) used () some CADL functions to return string dataWsuppath89 director) path of support fi"esWt'tasp current s)stem te't aspect ratio for note and dimension te'tWt'tatt89 arra) used () some CADL functions to return attri(utes for the dimension te'tWt'tinfo89 arra) used () some CADL functions to return integer data for the dimension te'tWunits current s)stem units mode, Eng"ish or MetricWverse" current verif) se"ection modeWvie& current s)stem vie& num(erWvie&mat8F9 current vie& matri'Wv&&"d current s)stem status of vie&&or"d s&itchW'cursor current > cursor "ocation

    W'cvie& "ast > coordinate va"ue returned () the 0osition Menu $construction vie&coordinates%W'ma' > ma' coordinate of current vie&port &indo&W'min > min coordinate of current vie&port &indo&W'vie& "ast > coordinate va"ue returned () the 0osition Menu $vie& coordinates%W'&or"d "ast > coordinate va"ue returned () the 0osition Menu $&or"d coordinates%W)cursor current Y cursor "ocationW)cvie& "ast Y coordinate va"ue returned () the 0osition Menu $construction vie&

    coordinates%W)ma' Y ma' coordinate of current vie&port &indo&W)min Y min coordinate of current vie&port &indo&W)vie& "ast Y coordinate va"ue returned () the 0osition Menu $vie& coordinates%W)&or"d "ast Y coordinate va"ue returned () the 0osition Menu $&or"d coordinates%W

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    20/231

    CADKEY Advanced Design Language (CADL) Guide

    char

    a sing"e character

    E'amp"e+

    char "etter, digit"etter =A=digit =F=

    dou("edou("e precision f"oating point data

    E'amp"e+dou("e ', )' 5.BB) 6.567VJIHGFFGHIJV76

    f"oat

    f"oating point data

    E'amp"e+f"oat ', )' 6.B) 5B.J

    intinteger

    E'amp"e+int ', )' 5) 5B

    "ong"ong integer

    E'amp"e+"ong ', )' 7F567) JJVF

    shortshort integer

    E'amp"e+short ', )' 5) J

    >1??? CADKEY Cor-oration age 26

    26

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    21/231

    CADKEY Advanced Design Language (CADL) Guide

    s"ist

    arra) of strings of characters

    E'amp"e+

    s"ist ')

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    22/231

    CADKEY Advanced Design Language (CADL) Guide

    Variable Declarations

    Data #)ping

    hen )ou use a varia("e for the first time and have done no data t)ping to it, it is assumed to (ea dou("e precision varia("e. Xo&ever, if )ou &ish to create a varia("e of an) other t)pe $i.e., int,char, etc.% )ou must data t)pe it in the fo""o&ing manner+

    datat)pe var5 8, var6, ... 9

    /or e'amp"e+

    int ', ), 1??? CADKEY Cor-oration age 2+

    2+

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    27/231

    CADKEY Advanced Design Language (CADL) Guide

    8f"ags98&idth981precision9t)pe

    Each parameter is descri(ed+

    #)pe is a character &hich appears after the "ast optiona" format fie"d. #his character te""s to theprogram &hether a character, string or num(er is (eing used. #his t)pe character ma) (e used&ith the percent sign a"one at an) time $e.g., f%.

    #hose other fie"ds "isted in the format a(ove are optiona". A fu"" description of each is descri(edin their section headings. Each is (rief") descri(ed here+

    #)pe characters supported are+

    d represents an integer t)pe &ith an output format of a signed decima" integer.

    u represents an integer t)pe &ith an output format of an unsigned decima" integer.

    o represents an integer t)pe &ith an output format of an unsigned octa" integer.

    ' represents an integer t)pe &ith an output format of an unsigned he'adecima" integer,using the characters BF and af.

    f represents a f"oating point t)pe &ith a signed va"ue having the form 89dddd.dddd, &heredddd is one or more decima" digits. #he num(er of digits (efore the decima" pointdepends on the magnitude of the num(er, and the num(er of digits after the decima"point depends on the re3uested precision.

    e represents a f"oating point t)pe &ith a signed va"ue having the form 89d.dddd e 8sign9ddd,&here d is a sing"e decima" digit, dddd is one or more decima" digits, ddd is e'act") threedecima" digits, and sign is or .

    g represents a f"oating point t)pe &ith a signed va"ue printed in 2f2 or 2e2 format, &hicheveris more compact for the given va"ue and precision $see (e"o&%. #he 2e2 format is usedon") &hen the e'ponent of the va"ue is "ess than V or greater than precision. #rai"ing

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    28/231

    CADKEY Advanced Design Language (CADL) Guide

    T used &ith the o or ' format, the 2T2 f"ag prefi'es an) non1??? CADKEY Cor-oration age 2

    2

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    29/231

    CADKEY Advanced Design Language (CADL) Guide

    at! "#nctions

    /o""o&ing is a "ist of functions &hich are offered () the s)stem and ma) (e used in an e'pressionto rep"ace a constant numeric va"ue.

    a(s $'%!eturns the a(so"ute va"ue of a num(er, '.

    Argument+' can (e an) constant va"ue, an assigned varia("e, or an e'pression.

    E'amp"e+' 6) a(s$'%$) &i"" (e e3ua" to 6%

    Error+none

    acos $'%

    !eturns the arc cosine of ', in the range of B to 5GB degrees.

    Argument+#he va"ue of ' must (e (et&een 5 and 5.

    E'amp"e+) acos$B.GI6%$) &i"" (e e3ua" to 7B.VJG5%

    Error+

    f the va"ue of ' is outside the a""o&ed domain, the error message =acos+ DOMAN error= isdisp"a)ed.

    asin $'%!eturns the arc sine of ' in the range (et&een FB and FB degrees.

    Argument+#he va"ue of ' must (e (et&een 5 and 5.

    E'amp"e+) asin$B.IJ%$) &i"" (e e3ua" to VB.JV5I%

    Error+f the va"ue of ' is outside the a""o&ed domain, the error message =asin + DOMAN error= isdisp"a)ed.

    atan $'%

    !eturns the arc tangent of ' in the range (et&een FB and FB degrees.

    >1??? CADKEY Cor-oration age 2?

    2?

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    30/231

    CADKEY Advanced Design Language (CADL) Guide

    Argument+' ma) (e an) constant va"ue or an assigned varia("e.

    E'amp"e+) atan$5H%$) &i"" (e e3ua" to GI.I77J%

    Error+none

    atan6 $), '%

    !eturns the arc tangent of )' in a range (et&een 5GB and 5GB degrees.

    Arguments+An) t&o va"ues, &ith the e'ception that the) are not (oth e3ua" to

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    31/231

    CADKEY Advanced Design Language (CADL) Guide

    uchar unsigned characterint integeruint unsigned integershort short integerushort unsigned short"ong "ong integer u"ong unsigned "ongf"oat f"oatdou("e dou("etcode copious entit) t)pe code

    E'amp"e+s copsi

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    32/231

    CADKEY Advanced Design Language (CADL) Guide

    Arguments+An) d, m, or s va"ue

    E'amp"e+) dms $67, 6, JJ%$) &i"" (e e3ua" to 67.BIJ7%

    Error+none

    e'p $'%

    !eturns the natura" e'ponentia" function, &hich is the va"ue e raised to the 'th po&er $e'%.

    Argument+' can (e an) va"ue.

    E'amp"e+) e'p$7%$) &i"" (e e3ua" to 6B.BGJJ%

    Error+hen the resu"tant va"ue overf"o&s, the va"ue is set to the "argest possi("e dou("e precisionva"ue.

    f"oor $'%!eturns the va"ue of ' rounded do&n the nearest integer $the integer f"oor%.

    Arguments+' can (e an) va"ue.

    E'amp"e+) J.GV' f"oor$)%$' &i"" (e e3ua" to J%

    Error+none

    fmod $', )%!eturns the modu"us, ' mod ). #he modu"us is the f"oating point remainder of an integerdivision.

    Arguments+' and ) can (e an) va"ues.

    E'amp"e+' JJ.76) fmod $', 7%$) &i"" (e e3ua" to 5.76%

    >1??? CADKEY Cor-oration age 82

    82

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    33/231

    CADKEY Advanced Design Language (CADL) Guide

    Error+none

    h)pot $', )%

    !eturns the "ength of the h)potenuse of a right triang"e, &hich is ca"cu"ated using s3rt$'6 )6%

    Arguments+#he "engths of the t&o "egs of a right triang"e, ' and ).

    E'amp"e+a 7.J( I.Hh h)pot$a, (%$h &i"" (e e3ua" to H.JJF5%

    Error+none

    "og $'%!eturns the natura" "ogarithm of '.

    Argument+An) num(er ' &hich is greater than or e3ua" to

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    34/231

    CADKEY Advanced Design Language (CADL) Guide

    a and ( can (e an) va"ues.

    E'amp"e+' po& $7, 6.J%$' &i"" (e e3ua" to 5J.JGGJ%

    Error+none

    sin $'%!eturns the sine of the ang"e ' in a range (et&een 5 and 5.

    Arguments+An) ang"e va"ue ', in degrees.

    E'amp"e+) sin$5I%$) &i"" (e e3ua" to B.6HJI7H%

    Error+none

    sinh $'%!eturns the h)per(o"ic sine of the ang"e ' &hich &i"" (e greater than or e3ua" to

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    35/231

    CADKEY Advanced Design Language (CADL) Guide

    Error+none

    s3rt $'%!eturns the s3uare root of '.

    Argument+An) num(er ' &hich is greater than or e3ua" to

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    36/231

    CADKEY Advanced Design Language (CADL) Guide

    #he !EM statement

    #he !EM statement can (e used to insert comments into )our code. #his 4e)&ord, as &e"" as

    an) fo""o&ing te't, is ignored () the s)stem &hen the program is e'ecuted. You therefore cou"da"so cause certain commands to (e ignored \ust () p"acing !EM in front of them.

    E'amp"e+

    !EM #his is \ust a comment

    !EM 0!OM0# 2#his command &i"" not (e e'ecuted unti" the !EM is removed2

    #he / statement

    #he / statement is used to conditiona"") e'ecute a portion of code. #he / has the format+

    / $e'pr%statement

    /irst, the e'pression $e'pr% is eva"uated. f it is true $non

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    37/231

    CADKEY Advanced Design Language (CADL) Guide

    *O#O "a(e"

    #his causes the program to (ranch to the statement immediate") fo""o&ing the specified "a(e".hen specif)ing the "a(e" in the *O#O statement, )ou don=t need to inc"ude the semico"on.

    ) using (oth the / and *O#O statements )ou create program "oops.

    E'amp"e+

    i 5

    +"oop0A:-E 2#he va"ue of i is d2,ii i 5/ $ i ? J %

    *O#O "oop

    n this e'amp"e, the 0A:-E command &i"" (e e'ecuted five times.

    #he ON *O#O statement provides )ou &ith an eas) &a) to (ranch to mu"tip"e "a(e"s (ased on acomputed va"ue. #he format for the ON *O#O statement is as fo""o&s+

    ON va"ue *O#O 8"a(e"5, "a(e"6, ...9

    f va"ue is computed to (e a negative num(er or 1??? CADKEY Cor-oration age 8

    8

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    38/231

    CADKEY Advanced Design Language (CADL) Guide

    E'iting a CADL program

    Norma"") a CADL program is done &hen it reaches the end of the fi"e. Xo&ever, if )ou &ant toterminate the program (efore it reaches the end of the fi"e, there are t&o statements to do it+

    AO!# and E>#. A"though the) (oth &i"" immediate") e'it the current program, there is adifference in &hat the) &i"" do after&ards.

    AO!# &i"" a"&a)s terminate the current program and return )ou to the CADKEY or C:##N*ED*E program.

    E># &i"" a"so terminate the current program, (ut if that program &as e'ecuted () a DO-:statement, E># &i"" return contro" over to the program &ith the DO-: statement in it. f thecurrent program &as not ca""ed () a DO-: statement, then it &i"" return )ou to the CADKEY orC:##N* ED*E program.

    -uspending CADL E'ecution

    #he A# command &i"" suspend CADL e'ecution for a specified num(er of seconds.

    Ca""ing E'terna" 0rograms or -)stem 0rocesses

    #o ca"" an e'terna" program or access a s)stem process, )ou must use the E>EC. hene'ecuted, this command temporari") suspends the s)stem and e'ecutes the command that )ouspecified. hen the program or process is comp"ete, contro" is returned to the statementimmediate") fo""o&ing the E>EC statement.

    Dec"aring the -ecurit) Code -tring

    #he CODE command dec"ares the proper securit) code string to a""o& fi"e e'ecution to occur. fthe CODE string does not match the securit) code string in -EC:!E.DA#, then the program &i""not run. #his command is not re3uired un"ess the defau"t -EC:!E.DA# fi"e supp"ied &ith )ourCADKEY or C:##N* ED*E insta""ation dis4ettes has (een changed.

    Compi"er-pecific Contro" -tatements

    #he fo""o&ing is a "ist of program contro" statements that can on") (e used in compi"ed programs$see the Compi"er section for detai"s%+

    CON#N:EDO ... XLEE>#LOO0/O!/LOCAL-#CX

    >1??? CADKEY Cor-oration age 8

    8

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    39/231

    CADKEY Advanced Design Language (CADL) Guide

    XLE

    >1??? CADKEY Cor-oration age 8?

    8?

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    40/231

    CADKEY Advanced Design Language (CADL) Guide

    Section To: Co!!ands

    Intro$#ction

    #he purpose of a command is to perform operations much "i4e functions found in the mainCADKEY or C:##N* ED*E program. A command consists of a 4e)&ord fo""o&ed () one ormore parameters. /or e'amp"e+

    -E# COLO!,7

    defines the current co"or as if )ou had used the mmediate Mode Command or the COLO!function. aria("e assignments ma) a"so (e used in descri(ing commands as e'p"ained under!egister aria("es.

    Note that a space is on") recogni1??? CADKEY Cor-oration age =6

    =6

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    41/231

    CADKEY Advanced Design Language (CADL) Guide

    -:00!E-- on") adds them to the data(ase $does not disp"a) them%

    #he fo""o&ing "ist specifies a"" the disp"a)a("e primitives supported in CADL+

    AN*DM $Angu"ar Dimension%A!CC!CLEC!DM $Circu"ar Dimension%CONC/NO#E, N/NO#E $/i"e Note%*ENDM $*eneric Dimension%LAEL, NLAELLEADE!,NLEADE!LNDM $Linear Dimension%LNE, LNENO#E, NNO#EO!DDM $Ordinate Dimension%0ON#, 0ON#0OLY*ON,

    0OLY*ON0OLYLNE-0LNE#NE--,N#NE-->XA#CX

    -ome primitives no& have t&o versions, one preceded () an =N= $the ne& st)"e%, and one &ithout$the o"d st)"e%. oth versions &i"" create the same entit) (ut the ne& versions ma4e use of thes)stem arra)s for input of parameters. #he o"d version ma) not (e supported in future versionsof CADL.

    Entity Control

    Dra&ing Entities#o dra& a particu"ar entit), use the D!AEN# command.n order to dra& the entit), it must (e at"east partia"") &ithin the current vie&port (ounds, (e in the current vie& and (e on a disp"a)ed"eve". #o dra& a"" entities at once, use the !ED!A command.

    De"eting Entities#o de"ete entities, use the DELEN# command. ith this command )ou can de"ete the "ast entit)found () one of the get entit) commands $i.e., *E#EN#, *E#NE>#, etc.%, de"ete a specific entit)() its D num(er, or e"se de"ete a"" entities current") in the se"ection "ist.

    A"igning Ordinate DimensionsO!DAL*N a""o&s )ou to a"ign the specified ordinate dimension entit). An ordinate dimension isa co""ective entit) and therefore, the D of on") one of its man) ordinates need (e passed. #hes)stem &i"" automatica"") a"ign the dimension.

    Entit) -e"ection

    #o se"ect an entit) () its D num(er, use *E#EN#D.

    >1??? CADKEY Cor-oration age =1

    =1

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    42/231

    CADKEY Advanced Design Language (CADL) Guide

    #o se"ect an entit) at a particu"ar >, Y vie& "ocation, use *E#EN#>Y.

    #o se"ect a"" entities &ithin the current &indo& (oundaries, use the *E#ALL command. f these"ection process is successfu", a se"ection "ist &i"" (e created, containing a"" the entitiesse"ected. #o process through the "ist, )ou must use the *E#NE># command. *E#NE># &i""retrieve the data for each entit) se"ected one at a time from the se"ection "ist. f )ou need toc"ear the se"ection "ist, use CLEA!-EL.

    Entit) Attri(utes

    DE/A##!, in con\unction &ith -E#A##!, a""o&s for a num(er of entit) attri(utes to (e changedthrough CADL fi"e e'ecution. #he purpose of DE/A##! is to define &hich attri(utes are to (e set,as &e"" as the order in &hich the) are to appear. Once defined, -E#A##! is ca""ed to actua"")modif) an entit)=s attri(utes. #he attri(utes )ou can set are+

    co"orfi"" co"orgroup num(er"eve" num(er"ine t)pe"ine &idthpen num(ersu(group num(erte't rotation ang"ete't aspect ratiote't fi"" modete't fontte't heightte't "ine spacing factorte't mirror modete't s"ant ang"ete't under"ine mode

    Display Control

    !edra&ing ie&portshen )ou change the sca"e of a particu"ar vie&port, or change &hich "eve"s are to (e disp"a)ed,the effects aren=t immediate") noticea("e. A"though the changes &ere made interna""), thevie&port$s% aren=t automatica"") updated. #o update them, )ou need to use the !ED!Acommand. !ED!A a""o&s )ou to redra& a specific vie&port or a"" of them at once.

    -ca"ing#he A:#O command &i"" sca"e the current part to f it tota"") inside the se"ected vie&port$s%. #o

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    43/231

    CADKEY Advanced Design Language (CADL) Guide

    C"earing a ie&port#he CL- command &i"" c"ear a specified vie& port, the primar) vie&port, or a"" of them. #hisc"ears on") the graphics that are disp"a)ed it doesn=t affect the entit) data in an) &a).

    -e"ecting Disp"a)ed Leve"s

    #he LEEL- command a""o&s )ou to turn a "eve" on or off. hen a "eve" is on, it &i"" (e disp"a)in the vie&port$s%. hen a "eve" is off, an) entities that are on that "eve" &i"" not (e disp"a)ed.You can se"ect a specific "eve" to turn on or off, or )ou se"ect a range of "eve"s.

    Leve" Descriptors#o set or retrieve the descriptor of an e'isting "eve", use the s)s_put_name and s)s_get_namecommands, respective").

    Vie'port Control

    Norma"i1??? CADKEY Cor-oration age =8

    =8

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    44/231

    CADKEY Advanced Design Language (CADL) Guide

    5. #he current vie&port mas46. #he primar) vie&port num(er7. #he num(er of avai"a("e vie&ports

    Vie' anip#lation

    Defining a Ne& ieo define a ne& vie&, )ou must use the E primitive $even if )ou &ant to use one of thepredefined vie&s%. You supp") the primitive &ith the nine num(ers that ma4e up the vie& matri'and it returns a CADL reference num(er for that vie&.

    Converting CADL !eference Num(ers to CADKEY ie& Num(ers

    #he CALL CDL6-Y- command &i"" convert a CADL reference num(er to a -)stem vie&num(er.

    ie& Descriptors#o set or retrieve the descriptor of an e'isting vie& , use the s)s_put_name and s)s_get_namecommands, respective").

    -etting the Disp"a) ie& and the Construction ie&

    #o set the disp"a) vie& to a specific -)stem vie& num(er, use the -E# E command. f )ou&ish to set the construction vie&, use -E# CE oth -E# E and -E# CE ta4e the-)stem vie& num(er as a parameter, not the CADL reference num(er.

    !etrieving a -)stem ie& Matri'#he *E#E command &i"" retrieve a specified s)stem vie& and store its vie& matri'e"ements in the s)stem arra), W/L#DA# in e"ements B through G.

    Coordinate -)stem #ransfer#here are four CALL commands that a""o& )ou to trans"ate the position of a point as )ou changevie&s.

    #o transfer a point from &or"d to vie& coordinates, there are t&o commands )ou can use. CALL>/ transforms a &or"d coordinate to a vie& coordinate using the current vie& matri'. CALL>/M transforms a &or"d coordinate to a vie& coordinate using a specified vie& matri'.

    #o transfer a point from vie& to &or"d coordinates, there are t&o commands )ou can use. CALL>/ transforms a vie& coordinate to &or"d coordinates using the current vie& matri'. CALL>/M transforms a vie& coordinate to &or"d coordinates using the specified vie& matri'.

    f )ou &ish to trans"ate a point from one vie& to another, )ou must use the &or"d coordinate asan intermediate step. /or e'amp"e, if )ou &anted to trans"ate a point from vie& 6 to vie& V, )ou&ou"d have to trans"ate from vie& 6 to &or"d coordinates, then from &or"d to vie& V coordinates.

    >1??? CADKEY Cor-oration age ==

    ==

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    45/231

    CADKEY Advanced Design Language (CADL) Guide

    User Interaction

    #he 0rompt LineMost of the commands in this section inc"ude a parameter that a""o&s )ou to modif) the prompt"ine. Xo&ever, )ou can a"so output a string to the prompt "ine at an) other time. #he t&ocommands, 0!OM0# and 0A:-E,&i"" output a specified string to the prompt "ine. #he on")difference (et&een the t&o is that 0A:-E &i"" output the string and then &ait for the user to hit?Enter@ (efore giving contro" (ac4 to the program. 0!OM0# prints out the string and thenimmediate") returns contro" to the program.

    Menus#he *E#MEN: command a""o&s )ou to specif) a string to (e disp"a)ed on the prompt "ine, up tonine menu options, &hich menu item, if an), &i"" (e considered the defau"t option, and &hether ornot to modif) the histor) "ine &hen the user ma4es a se"ection.

    CLEA!X-# &i"" c"ear the histor) "ine from a certain position to the end of the "ine. f no positionis specified, the entire histor) "ine &i"" (e c"eared.

    Data nput*E#/L#, *E#N#, and *E#-#! a""o& the user to input a f"oat, an integer, or a string,respective"). Each of these input commands a""o& )ou to set the string that &i"" (e output on theprompt "ine, set a defau"t va"ue and specif) up to nine menu choices. Contro" is returned to theprogram &hen the user either t)pes in a va"ue, se"ects a menu choice, or e"se hits E-CA0E orACK:0.

    *etting a 7D Coordinate*E#0O- disp"a)s a te't string on the first ha"f of the prompt "ine a"ong &ith the position menu,and then &aits unti" a 7D position is indicated using one of the options provided () the position

    menu.

    *E#C:! a""o&s )ou a "itt"e more contro" than *E#0O-. ith *E#C:!, )ou can specif) acursor st)"e from the fo""o&ing "ist+

    arro&crosshairsdrag (o'ru((er(and (o'ru((er(and "ine

    You can a"so disp"a) a menu in the menu area. Contro" returns to )our program &hen the usereither se"ects a menu item or a 7D position.

    -e"ecting Attri(utes*E#COLO! disp"a)s a te't string on the prompt "ine and a &indo& of co"or icons. You specif)&hether the num(er of se"ecta("e co"ors is 5I or 6JI. t then &aits for the user to se"ect one ormore co"ors.

    #o a""o& the user to se"ect a "ine t)pe from a &indo& of "ine t)pe icons, )ou need to use*E#L#Y0E. #o "et the user se"ect a "ine &idth, use the *E#LD#X command.

    >1??? CADKEY Cor-oration age =&

    =&

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    46/231

    CADKEY Advanced Design Language (CADL) Guide

    -e"ecting a 0"ane*E#0LANE a""o&s the user to choose a method for p"ane se"ection using p"ane se"ection menu.

    After the user has se"ected a method and then se"ected the p"ane, contro" is returned to theprogram.

    -e"ecting Entities*E#EN# disp"a)s a te't string on the prompt "ine, activates the graphics cursor, and &aits unti" asing"e entit) is se"ected. #o a""o& the user to se"ect more than one entit), )ou can use the*E#EN#M command. *E#EN#M invo4es the genera" se"ection mechanism and &aits unti" oneor more entities are se"ected. f the se"ection process &as successfu", )ou &i"" need to use*E#NE># to retrieve the data on each entit) in the "ist. f )ou need to c"ear this se"ected "ist ofentities, use the CLEA!-EL command.

    Chec4ing the Ke)(oard uffer:se *E#KEY to chec4 the s)stem 4e)(oard (uffer. f there is a character in the (uffer, thiscommand &i"" a"so return its character code, inc"uding the E-CA0E, ACK:0 and C! $?Enter@%4e)s.

    Data "ile Inp#t an$ O#tp#t

    nput Commands

    !EAD causes data to (e read from an A-C fi"e and set into specified varia("es. #he data fi"econsists of numeric va"ues separated () commas. /or each varia("e specified, a num(er ise'tracted from the data fi"e.

    N0:# reads characters, integers, and f"oating point num(ers from the current standard inputdevice in a variet) of &a)s through the use of a format string. N0:# is a more f"e'i("ea"ternative to the !EAD command. #he format string can contain an) num(er of fie"d specifiers

    &hich are used to descri(e ho& input data shou"d (e read and converted to varia("e va"ues. /oreach specifier, a varia("e name is parsed from the statement and set according").

    !EADDE reads the CADL digiti

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    47/231

    CADKEY Advanced Design Language (CADL) Guide

    &henever the E>EC command is processed. #his command can (e used to c"ose a data fi"e an)other time. DEO:# shou"d (e c"osed if DEN is to (e used to read &hat &as &ritten toDEO:#.

    Part an$ Pattern "ile Access

    -aving, C"osing, and Loading 0art /i"es#o "oad and c"ose part fi"es, use s)s_prt_"oad and s)s_prt_c"ose, respective"). hen saving apart use s)s_prt_save, )ou have the option of "oc4ing the fi"e and choosing if )ou &i"" &ant toover&rite a fi"e if it has the same name as the art )ou=re current") saving.

    0art /i"e Descriptors

    #o find out &hat the descriptor for the current") "oaded part is, use the s)s_prt_desc_in3command.

    #o set the part descriptor of the current") "oaded part, use s)s_prt_desc_set.

    -aving and Loading 0attern /i"es#he s)s_ptn_"oad and s)s_ptn_save commands "oad and save pattern fi"es, respective"). hen"oading a pattern, )ou have access to a"" the options that )ou &ou"d have if )ou &ere "oading apattern direct") from CADKEY or C:##N* ED*E. #hese options inc"ude grouping the pattern,p"acing the pattern on a particu"ar "eve", and setting the sca"e, rotation and vie& of the pattern.hen saving a pattern, )ou must specif) the entities to save in the pattern, either () theirindividua" D num(ers, or using the se"ection "ist $see *E#EN#M or *E#ALL%. You can a"sochoose to over&rite an e'isting pattern fi"e of the same name if it e'ists.

    Setting Syste% Val#es

    Co"or *raphics 0a"ette#o set one or more co"ors in the CADKEY co"or graphics pa"ette, use the 0ALE##E command.Each co"or defined is a com(ination of red, green, and ("ue intensities.

    0!AN*E a""o&s a range of co"ors in the -)stem graphics pa"ette to (e set such that a "inear("end is chosen (et&een the start and end !* $red, green, and ("ue% va"ues specified.

    *raphics Cursor Location

    -E#C:! sets the disp"a) of the current graphics cursor position to the specified vie& coordinateposition.

    Note #e't Attri(utes-E#NO#E performs the same function as using the DE#AL, -E# function of the s)stem. ta""o&s )ou to set various note te't parameters &hich &i"" (e assigned to a"" su(se3uent") creatednotes. #he attri(utes )ou can set are+

    aspect ratiofi""ed fontfont

    >1??? CADKEY Cor-oration age =

    =

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    48/231

    CADKEY Advanced Design Language (CADL) Guide

    "ine spacingfactorrotation ang"es"ant ang"ete't heightunder"ining

    Leve"s Disp"a)edLEEL- changes the "eve"s disp"a)ed () adding or removing either a sing"e "eve" or a range of"eve"s.

    Syste% Para%eters

    -)stem parameters can (e set through CADL fi"e e'ecution through use of the -E# command.#he parameters that can (e set () this command are as fo""o&s+

    Director) 0athsCADL director)note fi"es director)part fi"es director)pattern fi"es director)p"ot fi"es director)

    -)stem Mas4sco"or mas4entit) mas4"eve" mas4"eve" mas4"ine t)pe mas4"ine &idth mas4pen mas4se"ection mas4

    Dimension 0arameters

    arro&head directionarro&head st)"edimension te't fi""modedimension te't fontdimension te't heightdimension te't s"antang"e"eader st)"e"ine t)pe"ine &idthnote fi"" modenote fontnote rotation ang"e

    *enera" -)stem 0arametersconstructiondepthconstruction

    >1??? CADKEY Cor-oration age =

    =

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    49/231

    CADKEY Advanced Design Language (CADL) Guide

    modeconstructionp"anecoordinate entr)modecursor snapa"ignment andincrementcursor snap modecursor trac4ingdata(ase searchand dra& orderdecima" precisiondisp"a) ofconstruction vie&a'esdisp"a) vie& a'esgrid a"ignmentand incrementgrid mode

    immediate modecommand s&itch"ine "imit modestandard inputdevicestandard outputdevices)stem co"ors)stem "eve"s)stem pennum(ers)stem unit modeverif) se"ectionmodevie& num(er forspecific vie&port

    Strings an$ Arrays

    Cop)ing an Arra)CALL MEMC0Y &i"" cop) one or more e"ements from a one dimensiona" arra), at a specifiedsource inde', to a one dimensiona" destination arra) $starting at a specified destination inde'%.

    -tring /unctions

    #o concatenate t&o strings, )ou need to use the CALL function, CALL -#!CA#. #his functionta4es in t&o strings, s5 and s6, and concatenates s6 onto the end of s5. /or e'amp"e+

    s5 2Xe""o2s6 2 &or"d.2CALL -#!CA# s5, s6

    After this is e'ecuted, s5 &i"" contain the fo""o&ing string+

    >1??? CADKEY Cor-oration age =?

    =?

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    50/231

    CADKEY Advanced Design Language (CADL) Guide

    2Xe""o &or"d.2 $inc"uding a nu"" terminator%

    #o compare t&o strings, there are t&o CALL functions )ou can use. #o ma4e a casesensitivecomparison of t&o strings, use CALL -#!CM0. #o compare t&o strings &ithout regard to "ettercase, use CALL -#!CM0 oth functions &i"" te"" )ou if the strings match or e"se &hich string isof greater va"ue at the first non matching character.

    #o cop) one string to another, )ou need to use the CALL -#!C0Y function. $f )ou on") &ish tocop) a particu"ar section of a string, use the CALL MEMC0Y function%.

    #he CALL -#!LEN function &i"" return the "ength of a string, not inc"uding the nu"" terminator.

    #o convert a string to a f"oating point va"ue, )ou need to CALL -#!/L#. #o convert a string to aninteger va"ue, use the CALL -#!N# function.

    -0!N# a""o&s )ou to &rite characters, integers, and f"oating point num(ers into a string varia("ethrough the use of a format string.

    Vector at! "#nctions

    #he ca"cu"ate the cross product of t&o vectors, use CALL C!O--.

    #he dot product of t&o vectors is ca"cu"ated using the CALL DO#0!OD function.

    #o determine an arc tangent that &or4s in a"" four 3uadrants and outputs a va"ue in the range ofB.B to 61pi, use CALL A#AN7.

    Copio#s Entities

    Copious entities are nondisp"a)a("e data entities that are accessi("e on") through CADL. #heseentities are stored in the part fi"e &hen the part fi"e is saved, so that the) are avai"a("e &hen thepart fi"e is "oaded again. #here are three groups of commands that manipu"ate, respective")+

    5. #he different t)pes or c"asses of copious entities.6. #he copious entities under each t)pe.7.#he data stored in each copious entit).

    Copious #)pesA copious t)pe identifies a group of copious entities () name and t)pe num(er. Ever) copiousentit) created must (e"ong to an e'isting copious t)pe.

    #he command for defining a copious t)pe is ADDC#Y0E. #here can (e a ma'imum of 6JIcopious t)pes in a part fi"e at one time.

    #o de"ete a copious t)pe, use the DELC#Y0E command. You can on") de"ete a copious t)pe&hen no copious entities e'ist of that t)pe.

    f )ou 4no& the name of the copious t)pe and )ou need to 4no& its t)pe num(er, useN]#CODE. f )ou 4no& the t)pe num(er and need the name, use N]C#Y0E.

    >1??? CADKEY Cor-oration age &6

    &6

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    51/231

    CADKEY Advanced Design Language (CADL) Guide

    Copious EntitiesA copious entit) can (e created in a part fi"e () defining its si

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    52/231

    CADKEY Advanced Design Language (CADL) Guide

    Adding Entities #o A Co""ective#o add an entit) to a co""ective or to com(ine t&o co""ectives, use the ADDCOLL command. #hiscommand ta4es as parameters t&o entit) D=s. f )ou &ish to add an entit) to a co""ective, one Dmust (e of an entit) a"read) inside the co""ective, and the other &i"" (e the entit) )ou &ish to add.f )ou &ant to com(ine t&o co""ectives, pic4 an entit) D from (oth co""ectives and the t&oco""ectives &i"" (e \oined.

    !emoving Entities /rom A Co""ective#o remove a sing"e entit) from a co""ective, use the !EMCOLL command.

    f )ou &ish to remove a"" entities from a specific co""ective, use :!-#COLL. A"" )ou need tospecif) is one D from an entit) &ithin the co""ective.

    Contro""ing Co""ective -e"ection2-E# co""se", mode2 contro"s the manner in &hich co""ective entities are put into the se"ection "ist&hen se"ected using *E#EN#, *E#EN#M, *E#EN#>Y and *E#ALL. f mode is set to B, a"" theentities in the co""ective are high"ighted and the first entit) is put into the se"ection "ist. #he restof the entities in the co""ective cannot (e se"ected through user interaction (ut on") &ith theNE>#COLL command. f mode is set to 5, on") the se"ected entit) is high"ighted and put into these"ection "ist.

    Gro#ps

    Creating a *roup

    #he *!O:0 primitive sets up a group &ith a specified num(er of su(groups. #he *!O:0primitive a"so re3uires that )ou inc"ude a group name, a string up to eight characters in "ength,and the group reference num(er. #his num(er is used in other primitive ca""s to p"ace an entit)in a specified group upon creation.

    *etting *roup nformation*E#*!O:0 &i"" return the group name and su(group f"ags for a specified group referencenum(er.

    Dialog (o) anager (asics

    A dia"og (o' is a co""ection of entities that are set up () the app"ication and then manipu"ated ()the user. Current"), the dia"og (o' manager supports 55 entit) t)pes. #he) are+ (uttons, radio(uttons, chec4 (o'es, "ist (o'es, notes, (o'es, input fie"ds, and com(o (o'es.

    #his chapter descri(es the dia"og (o' commands. #hese commands provide dia"og (o'management for the user interface.

    /or each entit) t)pe, there are routines to create an entit), change an entit)=s attri(utes, and togather information from an entit). #here are a"so routines for creating a dia"og (o', running adia"og (o', and destro)ing a dia"og (o'.

    >1??? CADKEY Cor-oration age &2

    &2

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    53/231

    CADKEY Advanced Design Language (CADL) Guide

    Dia"og o' Coordinate -)stemsecause dia"og (o'es are imp"emented as a specia" case of a te't &indo&, the Ya'is runs fromtop to (ottom. A"so, a"" num(ers are in 2font units.2 #herefore, an icon defined to reside at B,B atthe top "eft of the dia"og (o'. f it is 6 units high () 6 units &ide, it is as (ig as a 6 () 6 stac4 of"etters. #his scheme a""o&s a"" dia"og entities to sca"e correct") regard"ess of reso"ution or te'tfonts avai"a("e on the target machine. A"so, note that the coordinates for anchor points are

    dou("es.

    Dia"og o' Design ConsiderationsDo not define a dia"og (o' (igger than can (e sho&n on a IVB'VGB screen.

    Creating a Dia"og o'

    #he dia"og (o' is identified () an D. #his D is preserved for the "ife of a dia"og (o'. Anapp"ication uses this D as the 2dia"og (o' hand"e.2 #his hand"e is used for most of the providedroutines.

    #he dg_init_dia"og command creates a dia"og (o'. and returns a va"ue in the s)stem varia("eWE!!O!. #he va"ue in WE!!O! is either a dia"og (o' hand"e, or B if it cou"d not satisf) there3uest.

    Chi"d Dia"og o'esYou can define a dia"og (o' to (e a chi"d of another dia"og (o'. A chi"d dia"og (o' disp"a)s on")if its parent is current") disp"a)ed. #he chi"d dia"og (o' must (e comp"ete") inside the parent.#he dia"og (o' manager tries to enforce this ru"e, (ut it is possi("e to confuse it in patho"ogica"cases.

    #he chi"d dia"og (o' a"so has a dia"og (o' hand"e. hi"e &or4ing inside a chi"d dia"og (o', itshand"e shou"d (e used.

    After initia"i1??? CADKEY Cor-oration age &8

    &8

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    54/231

    CADKEY Advanced Design Language (CADL) Guide

    Destro)ing A Dia"og o'#he dg_free_dia"og command frees a"" associated memor), and destro)s the dia"og (o'. You canuse this after )ou comp"ete user interaction.

    Dialog (o) Entities

    Entit) nde'Each entit) has a uni3ue inde' num(er associated &ith it. hen )ou create a dia"og (o', )oumust specif) items to (e the ma'imum num(er of entities )ou p"an to create. As )ou arecreating entities, )ou can then specif) an) inde' as "ong as it=s in the range (et&een B and$items5%. #he inde' can then (e used to+

    5% Notif) )ou that an entit) has changed.6% #e"" the dia"og (o' manager &hich entities= attri(utes to change.7% !e3uest information a(out an entit).V% Modif) or de"ete an entit).

    Entit) 0ositionEach entit) has an anchor point, specified in te't coordinates.

    You manipu"ate attri(utes &ith dg_get_f"ags and dg_set_f"ags. #hese commands return and setthe attri(utes for the specified entit), respective").

    You can a"so specif) attri(utes (its &hen )ou create an entit).

    uttons#he dg_add_(utton command creates a (utton.

    #he (utton has a space (efore and after the te't, &hich is centered in the (utton. -pecif) theva"ue of nc, so that dia"og (o'es that trans"ate into foreign "anguages sti"" "ine up correct").

    A (utton has a f"ag va"ue D*_!E#_ON_-EL$B'BBB5% specified () defau"t. uttons ta4e up ane'tra ce"" in each direction around them, for the effect.

    E'tracting utton nformation

    #here is no information to e'tract. #he dia"og (o' manager te""s )ou that a (utton has (eenpressed.

    o'esA (o' is an entit) that sho&s group associations. You create a (o' &ith the dg_add_(o'. #here

    is no information to e'tract from a (o'.

    nput /ie"ds

    #here are three t)pes of input fie"ds+ -#!N*-, DO:LE-, and N#-. #he ca"cu"ator processesa"" input for dou("e fie"ds, so the user can t)pe 27 V.JH Wdepth2 into a dou("e fie"d, and thecomputed va"ue is p"aced in the fie"d.

    >1??? CADKEY Cor-oration age &=

    &=

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    55/231

    CADKEY Advanced Design Language (CADL) Guide

    #o input a va"ue use the dg_add_te't_dou("e, dg_add_te't_int and dg_add_te't_stringcommands.

    E'tracting nput /ie"d nformation

    #he dg_get_te't_dou("e, dg_get_te't_string, and dg_get_te't_int commands return the currentva"ue of an input fie"d.

    Modif)ing nput /ie"ds

    You can modif) the contents of an input fie"d. #he dg_set_te't_dou("e, dg_set_te't_string, anddg_set_te't_int commands give a ne& va"ue to the fie"d. #o change the t)pe of the fie"d, de"eteit and recreate it.

    NotesA note is a string of te't in the dia"og (o'. f )ou set the f"ag va"ue to D*_!E#_ON_-EL$B'BBB5% for a note, it acts "i4e a (utton, (ut &ithout the high"ighting effect. :se this foremu"ating a h)perte't or !ich #e't /ormat $!#/% app"ication.

    !adio uttons!adio (uttons a""o& the user to choose one option from a mu"tip"e option se"ection. #heapp"ication specifies the strings for each choice, and &hich one is current") chosen. #he userchanges the se"ection () c"ic4ing on either the (o' or the associated te't. f the te't va"uepassed to dg_add_radio is omitted, )ou can add the entries, one at a time, usingdg_set_radio_te't

    E'tracting !adio utton nformation

    :se the dg_get_radio command to e'tract information from a radio (utton. #his commandreturns the current") se"ected radio (utton in the set.

    Modif)ing !adio utton nformation

    You change the active e"ement &ith the dg_set_radio command. You set or change the te't stringfor a fie"d &ith dg_set_radio_te't.

    #o change the num(er of (uttons, de"ete the entit) and add it again.

    List o'es

    List (o'es provide the mechanism for se"ecting a string from a potentia"") "arge set of strings. fthe te't passed to dg_add_"ist omitted, the strings can (e added "ater using dg_set_"ist_te't.

    E'tracting List o' nformation

    You e'tract "ist (o' information &ith dg_get_"ist. #his command returns the inde' of the stringchosen () the user.

    #o retrieve the actua" te't string of a se"ection, use the dg_get_"ist_te't command

    Modif)ing List o' nformation

    #o change the se"ected item, use dg_set_"ist. #o set or change a "ist item, use dg_set_"ist_te't. f"ist item )ou se"ect is greater than the num(er of items in the "ist, the "ist e'pands to the ne&amount.

    #o de"ete an item from the "ist, use dg_de"_"ist_te't.

    >1??? CADKEY Cor-oration age &&

    &&

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    56/231

    CADKEY Advanced Design Language (CADL) Guide

    Chec4 o'es

    A chec4 (o' provides a simp"e togg"e. #o add a chec4 (o' use the dg_add_chec4 command.

    E'tracting Chec4 o' nformation

    You e'tract information from a chec4 (o' &ith dg_get_chec4. #his command returns the statusof the specified chec4 (o'.

    Modif)ing Chec4 o' nformation

    #o change the state of a chec4 (o', use dg_set_chec4.

    Com(o o'esA com(o (o' is a "ist (o' &ith an attached input fie"d. #he user se"ects an item from the "ist (o'or enters a string into the input fie"d. f the Must E'ist f"ag is true, the user must se"ect from the"ist. f the input fie"d is used, the t)ped string &i"" force itse"f to match one of the "ist items. f thete't is omitted, use dg_set_com(o_"ist_te't to specif) the te't strings "ater. #o add a com(o (o'

    use the dg_add_com(o command.

    E'tracting Com(o o' nformation

    You e'tract information from a com(o (o' &ith dg_get_com(o_string ordg_get_com(o_"ist_active. #he dg_get_com(o_string command returns a string va"ue of thespecified com(o (o' in the W-#!DA# s)stem arra) &hi"e dg_get_com(o_"ist_active returns the"ist inde' of the active e"ement of the specified com(o (o'.

    Modif)ing Com(o o' nformation

    #o set or change a "ist item in a com(o (o', use dg_set_com(o_"ist_te't. f the item=s num(er isgreater than the current tota" num(er of items, the "ist e'pands to the ne& amount.

    #o de"ete an item from the com(o "ist, use dg_de"_com(o_"ist_te't

    #o change the input string in a com(o (o', use dg_set_com(o_string and to change the active"ist e"ement and the input string in a com(o (o', use dg_set_com(o_"ist_active.

    #it"esAn) entit) can have a tit"e. You can add a tit"e to an) entit) after )ou create it. #he r and cva"ues for this command are re"ative to the entit) not a(so"ute. #o add a tit"e use the dg_add_tit"ecommand.

    De"eting Entities#o remove an entit) from a dia"og (o', use dg_de"_ent. After )ou de"etean entit), )ou can reuse

    its inde' num(er for a ne& entit).

    Errors n Creation And Modification

    #here are man) reasons &h) the dia"og (o' manager returns errors. #hese inc"ude+ modif)ingthe &rong inde', for e'amp"e, ca""ing dg_set_ce""_string on an entit) &hich isn=t a ta("e inde'ingout of (ounds or other errors. #he dia"og (o' manager uses the s)stem varia("e WE!!O! topass (ac4 error status. #he varia("e sets to

  • 7/26/2019 CADKEY Advanced Design Language (CADL) Guide

    57/231

    CADKEY Advanced Design Language (CADL) Guide

    WE!!O! is c"eared after an) successfu" ca"", so e'amine it after ever) dia"og (o' manager ca"".

    !unning the Dia"og o'Once )ou create a dia"og (o' and add a"" of )our entities, )ou can dra& the dia"og (o' and get

    user input.

    #o dra& the dia"og (o' ca"" dg_dra&_dia"og, then use dg_run_dia"og. t returns an integer, &hichis the inde' of the (utton that the user pressed. A"so, it cou"d (e the inde' of an) other fie"d if)ou set the f"ag va"ue to D*_!E#_ON_-EL $B'BBB5% f"ag for that fie"d and change it.

    -e"ecting the /ocus#he dia"og (o' manager a"&a)s 4no&s &hich entit) has the focus. #he entit) &ith the focus haspriorit) for 4e)(oard input and mouse pic4s. /or e'amp"e, if )ou have a drop do&n com(o (o'that over"a)s other fie"ds &hen it drops, the manager 4no&s that mouse pic4s go first to thecom(o (o', and not to the o(scured entities, (ecause its attention is focused on that o(\ect. #hefocus shifts &i


Recommended