#### IDs for features within subroutines, basic scripts, or external programs

Subroutines can be located within the current part program or in an external part program. When the subroutine is located in the same program as the call to the subroutine, the feature array ID syntax explained under "Feature Arrays:" can be used to refer to individual instances of a feature created in the subroutine. However, when the subroutine is located in an external part program, the following syntax can be used to refer to any features created in the subroutine: "<Call Sub ID>:<FeatID>". For example, if a feature named "F1" were located in an external subroutine that was called from a Call Sub command with the id "CS1", then the ID expression "CS1:F1" could be used to refer to that feature.

Example: This example merely illustrates the use of the syntax CS1.F1 and is not intended to use.

Program 1: PLUS1.PRG

> SUBROUTINE/PLUS1, A1 = 0, A2 = 0, A3 = 0
> F1 =FEAT/POINT,RECT
> THEO /A1+1,A2+1,A3+1,0,0,1
> ACTL/3,1,1,0,0,1
> MEAS/POINT,1
> HIT /BASIC,A1+1,A2+1,A3+1,0,0,1,0,0,0
> ENDMEAS/
> ENDSUB/

Program 2: TEST.PRG

> CS1 =CALLSUB/PLUS1,D:\V30\WINDEBUG\PLUS1.PRG: 3,3,3,,
> DIM D1= LOCATION OF POINT CS1:F1 UNITS=IN,$
> GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
> AX NOMINAL +TOL -TOL MEAS MAX MIN DEV OUTTOL
> X 3.0000 0.0000 0.0000 3.0000 3.0000 3.0000 0.0000 0.0000
> ----#----
> END OF DIMENSION D1

Basic scripts create and delete objects dynamically. Use the syntax "<Basic Script ID>:<Feat ID>" to refer to a feature created by a basic script. For example, if a basic script with ID "BS1" creates a feature with ID "F2", use the ID expression "BS1:F2" to refer to that feature.

External programs can be attached to PC-DMIS using the attach command. To refer to features in the attached program use the following syntax: "<Attach Prog ID>:<Feat ID>". To refer to feature "F3" in the attached part program with ID "GEAR1", use the expression, "GEAR1:F3". (See "Attaching an External Part Program" in the "Adding External Elements" chapter for more information.)