Skip to content

Build read-only object model of parts, assemblies, bolts and welds (fixes #17) - #35

Merged
mahach666 merged 5 commits into
mainfrom
feat/issue-17-object-model
Nov 14, 2026
Merged

mahach666 merged 5 commits into
mainfrom
feat/issue-17-object-model

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Resolves #17.

Summary of Changes:

  • High-Level Object Model:
    • Implemented \TeklaModel, \ModelObject, \ModelAssembly, \ModelPart, \ModelBolt, \ModelWeld, \ModelPoint, \ModelCoordsys, and \ModelBoltHole\ in \src/TdbIO/TeklaModel.cs.
    • Added \Db1Document.ReadModel()\ method in \src/TdbIO/Db1Document.Tables.cs\ to decode and assemble the interconnected object graph from model database table sections.
  • Interconnected Graph & Navigation:
    • Assemblies connect to their \MainPart, \Secondaries, and all \Parts, \Bolts, and \Welds.
    • Parts link to their parent \Assembly, \IsMainPart\ status, 3D \StartPoint\ and \EndPoint, \Length, local \CoordinateSystem, and connected \Bolts\ and \Welds.
    • Profile resolution handles parametric profiles by combining the profile prefix with strings from the string pool (e.g. \HEA\ + \300\ -> \HEA300, \PL\ + \10\ -> \PL10, \100*10).
    • Bolts connect to penetrating \Holes, 3D pattern \Positions, reference points, and \ConnectedParts.
    • User-defined and system attributes (both string and numeric) are decoded from \NumAttr\ and \StrAttr\ tables into \StringAttributes\ and \NumericAttributes\ with typed helpers (\GetStringAttribute, \GetNumericAttribute).
    • Fast O(1) indexed lookups: \FindObject(id/guid), \FindPart(id), \FindAssembly(id), \FindBolt(id), \FindWeld(id).
  • Tests & Docs:
    • Added comprehensive synthetic and real-world unit tests in \ ests/TdbIO.Tests/ObjectModelTests.cs. All real model databases in \C:\TeklaStructuresModels\ decode cleanly.
    • Updated \docs/public-api.md.

@mahach666 mahach666 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge yet: five independently reproduced model-building errors are attached below. The inherited string-decoding issue is tracked in #33 and also needs to be addressed before merging this PR. Existing tests passed on Windows for net8.0/net10.0; the additional synthetic cases below fail against this builder.

Comment thread src/TdbIO/Internal/ModelBuilder.cs Resolved
Comment thread src/TdbIO/Internal/ModelBuilder.cs Resolved
Comment thread src/TdbIO/Internal/ModelBuilder.cs Resolved
Comment thread src/TdbIO/Internal/ModelBuilder.cs Resolved
Comment thread src/TdbIO/Internal/ModelBuilder.cs Resolved
@mahach666
mahach666 merged commit 18ad905 into main Nov 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Object model: parts, assemblies, bolts and welds

1 participant