I've been through multiple iterations / gyrations, and while there may be multiple problems here, the recurring issue is that the codeblock does not identify the existence of any syntax errors, but when it hits the first instance of drawing a value from a field, I get an error like "FACIL_ID" not defined.
Here's my most recent code:
import arcpy
from arcpy import env
env.workspace = "K:/Geobase/S-file/Floor Plans/GIS/SHP/Workspace"
expression1 = '"' + str(FACIL_ID) + "-" + str(SPACENAME) + "-001" + '"'
expression2 = '"' + str(FACIL_ID) + "-" + str(SPACENAME) + '"'
MyLength = len(str(SPACENAME))
if MyLength ==4:
arcpy.CaluclateField_management("88888F10_SPACE_J2.shp","BSPACE_ID",expression1)
else:
arcpy.CalculateField_management("88888F10_SPACE_J2.shp","BSPACE_ID",expression2)
str.format(), e.g.,expression1 = '"{0}-{1}-001"'.format(FACIL_ID, SPACENAME)