06_Code_ReferenceGlobal Configuration

Global Configuration

Purpose

This note explains the role of GlobalConfiguration.json in the HAPI PythonNet3/Civil 3D drafting engine.

Source Priority

  1. GlobalConfiguration.json
  2. Global Configuration Specification.md
  3. Feature Catalogue Specification.md
  4. HAPI User Manual.pdf

Definition

GlobalConfiguration.json defines project-wide constants, default Civil 3D style names, resource filenames, folder paths, and mathematical thresholds used by the HAPI drafting engine.

It provides fallback rules when the Feature_Catalogue does not supply more specific behaviour.

Resource and Path Fields

FieldCurrent ValueMeaning
CSWPAgentCodeHSDAgent code used in the current deployment.
WkEnvRootDirectoryPathX:\HAPI-Core\Payload\Root payload directory.
ConfigDirectoryPathsrc\Config\Config folder.
TemplatesDirectoryPathsrc\Templates\Template folder.
ObjectsDirectoryPathsrc\StylesObjects\ECM object source folder.
StylesDirectoryPathsrc\StylesJSON\Style JSON folder.
SymbolResourcesFilenameRES80 [Symbol Resources].DWTSymbol resource drawing/template.
LegendResourcesFilenameRES46 [Legend Resources].DWTLegend resource drawing/template.

Mathematical and Drafting Thresholds

FieldCurrent ValueMeaning
FriendlyNeighborhoodThreshould0.25Proximity tolerance for polygon closure logic.
LinestyleAnnotationInterval50Base interval for distributing line annotations.
NurbsCurveToPolyCurvePrecision0.5Tessellation precision for converting curves into linear vertex lists.
DefaultSymbolArbitraryDimension1.5Fallback dimension for arbitrary generated symbols or one-point rectangle cases.

Note: FriendlyNeighborhoodThreshould preserves the current configuration spelling. Do not silently rename it in code unless a migration layer is explicitly implemented.

COGO Point Marker Styles

FieldCurrent ValueMeaning
DefaultLevelStyleNameStandardDefault visible point marker style.
DefaultSuppressStyleNameSuppressedSuppressed point style.
DefaultLevelNotReqStyleNameLevel Not RequiredMarker style when level display is not required.

Datum Dictionary / Label Fallbacks

FieldCurrent ValueMeaning
DefaultLevelLabelNameHKPD | Spot LevelStandard spot level label.
DefaultInvertLevelLabelNameHKPD | Invert LevelInvert level label.
DefaultCrownLevelLabelNameHKPD | Crown LevelCrown level label.
DefaultDepthLabelNameHKCD | Chart DepthBathymetry / depth label.
DefaultFeatureCurveLabelNameGeneric | Tag OnlyDefault feature curve label.

Relationship to Feature Catalogue

The Feature_Catalogue defines feature-specific rules. Global Configuration defines fallbacks and global constants.

Example relationship:

SurveyRecord.FeatureCode
FeatureCatalogue entry
Specific style / label / routing field
Fallback to GlobalConfiguration when missing or globally overridden

Business Rules

  1. Global Configuration should not replace feature-specific catalogue data.
  2. Use Global Configuration as fallback, not as hard-coded constants in scripts.
  3. Preserve current field names unless a migration strategy is explicitly defined.
  4. Mathematical thresholds should be documented because they affect geometric behaviour and test expectations.

Implementation Notes

Preferred planned functions:

  • LoadGlobalConfiguration
  • ResolveDefaultPointStyle
  • ResolveDefaultLabelStyle
  • ResolveDatumLabelStyle
  • GetFriendlyNeighborhoodThreshold
  • GetCurveTessellationPrecision

Open Questions

  • Confirm whether the misspelt field FriendlyNeighborhoodThreshould should remain unchanged for backward compatibility or be migrated to FriendlyNeighborhoodThreshold with alias support.
Built with LogoFlowershow