06_Code_ReferenceFeature Catalogue

Feature Catalogue

Purpose

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

Source Priority

  1. FeatureCatalogue.json
  2. Feature Catalogue Specification.md
  3. HAPI User Manual.pdf
  4. Old implementation Markdown notes

Definition

FeatureCatalogue.json is the central feature dictionary and rulebook for the HAPI engine. It maps each Feature_Code to its mathematical routing, drafting style, block behaviour, label behaviour, and ECM object availability.

Catalogue Scale

The current catalogue contains 197 feature entries.

Feature TypeCount
LINEAR79
1POINT70
POLYGON41
2POINT7

Top-Level Structure

Each feature entry is organised into three major sections:

{
  "featureMetadata": {},
  "symbolConfig": {},
  "objectConfig": {}
}

featureMetadata

FieldMeaning
FeatureCodePrimary feature key, such as KX, TE, or STN.
FeatureNameHuman-readable feature name.
FeatureTypeMathematical routing channel: 1POINT, 2POINT, LINEAR, or POLYGON.
FeatureImageReference image filename.
ColourCodeAutoCAD Color Index for drafted outputs.
CSWPClassDrafting specification class.
RevisionCatalogue revision marker.

symbolConfig

Common Fields

FieldMeaning
isLevelRequiredDetermines whether visible/default level marker style should be applied.
isAnnotationRequiredDetermines whether a specific label style override is required.
SymbolLevelTypeMaps to the Datum Dictionary in Global_Configuration.
SymbolAnnotationNameSpecific Civil 3D label style when annotation override is active.
isSymbolRequiredGlobal gatekeeper for whether standard symbol drafting is required.

1POINT / 2POINT Fields

FieldMeaning
PointSymbolUseBlkRefIf true, insert a block reference.
PointSymbolBlockNameExact AutoCAD block name.
PointSymbolAlignToKerbIf true, rotate the block relative to nearby kerb geometry.
PointSymbolParameterDynamic block or object parameters to set.

POLYGON Fields

FieldMeaning
SymbolGroupingLengthsDefault number of points used when no Sizing_Number is supplied.
MultiPolySymbolUseBlkRefIf true, route polygon to scalable block mode.
MultiPolySymbolBlockNameBlock name for polygon block route.
MultiPolySymbolAnnotatedIf true, place polygon annotation.
MultiPolySymbolStyleNameFeature Line or polygon style name.
MultiPolySymbolLabelNameLabel style name for polygon annotation.

LINEAR Fields

FieldMeaning
isSymbolAllowCurveSegmentDetermines whether curve indicators should be processed.
FeatureLineStyleNameCivil 3D Feature Line style name.
FeatureLineAnnotatedWhether line labels should be generated.
FeatureLineLabelNameLabel style for line annotation.
FeatureFlowAnnotatedWhether flow arrows or flow labels should be generated.
FeatureFlowLabelNameFlow label style name.

objectConfig

FieldMeaning
isObjectAvailableWhether an ECM object profile is available.
ObjectDWGFilenameSource object drawing filename.
ObjectDefaultStyleTypeDefault Style Type Key.
ObjectStyleProfileJSONMapping between Style Type Keys and style profile JSON files.

Example Feature Entries

Feature CodeNameFeature TypeKey Catalogue Behaviour
KXKerb BottomLINEARCurve segment capable; Feature Line route.
CPCatch PitPOLYGONDefault grouping length 3; can use block-reference polygon route.
FBFlower BedPOLYGONDefault grouping length 3; polygon annotation route.
TETree1POINTTree object style available.
STNControl Station1POINTSurvey control class and annotation route.

Business Rules

  1. The catalogue is the routing authority for Feature Type.
  2. Do not hard-code block names, Feature Line styles, or label names in drafting logic if they are catalogue fields.
  3. Catalogue fields should be queried on demand by Feature Code.
  4. The catalogue should be treated as configuration, not as procedural code.
  5. Unknown fields should be preserved where possible for forward compatibility.

Implementation Notes

Preferred planned functions:

  • LoadFeatureCatalogue
  • QueryFeatureCatalogue
  • ValidateFeatureCatalogueEntry
  • ResolveFeatureType
  • ResolvePointSymbolConfig
  • ResolveLinearFeatureConfig
  • ResolvePolygonFeatureConfig
  • ResolveObjectStyleProfile

Open Questions

  • Confirm whether compound feature rules should be added directly to FeatureCatalogue.json or maintained in a separate supplementary-suffix catalogue.
Built with LogoFlowershow