Skip to content

Commit cbaf737

Browse files
committed
update to v0.2 beta
1 parent 8e6143d commit cbaf737

7 files changed

Lines changed: 455 additions & 40 deletions

File tree

README.md

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,234 @@ EtabSharp/
202202
│ └── System/
203203
204204
└── Exceptions/
205+
206+
207+
etabvcs/ # Root project
208+
├── Cargo.toml # Workspace configuration
209+
├── package.json # Frontend dependencies
210+
├── vite.config.ts
211+
├── tsconfig.json
212+
├── tailwind.config.js
213+
├── README.md
214+
├── .gitignore
215+
216+
├── src/ # Frontend (React + TypeScript)
217+
│ ├── main.tsx
218+
│ ├── App.tsx
219+
│ ├── components/
220+
│ │ ├── ModelViewer/
221+
│ │ │ ├── ModelViewer.tsx # 3D model visualization
222+
│ │ │ ├── StoryView.tsx # Story-by-story view
223+
│ │ │ ├── MemberList.tsx # Columns/Beams/Walls list
224+
│ │ │ └── GridOverlay.tsx # Grid display
225+
│ │ ├── VersionControl/
226+
│ │ │ ├── CommitHistory.tsx # Git commit history
227+
│ │ │ ├── CommitDialog.tsx # Commit changes dialog
228+
│ │ │ ├── DiffViewer.tsx # Show model differences
229+
│ │ │ └── BranchSelector.tsx # Branch management
230+
│ │ ├── DataTables/
231+
│ │ │ ├── StoriesTable.tsx # Stories data
232+
│ │ │ ├── PointsTable.tsx # Points coordinates
233+
│ │ │ ├── MembersTable.tsx # Structural members
234+
│ │ │ └── LoadsTable.tsx # Load patterns/cases
235+
│ │ ├── Analysis/
236+
│ │ │ ├── StatisticsPanel.tsx # Model statistics
237+
│ │ │ ├── ValidationResults.tsx # Validation errors
238+
│ │ │ └── ComparisonView.tsx # Compare two models
239+
│ │ └── Settings/
240+
│ │ ├── CliSettings.tsx # EtabSharp CLI path config
241+
│ │ └── GitConfig.tsx # Git user settings
242+
│ ├── store/
243+
│ │ ├── index.ts
244+
│ │ ├── modelSlice.ts # Current model state
245+
│ │ ├── vcsSlice.ts # Version control state
246+
│ │ └── uiSlice.ts # UI state
247+
│ ├── hooks/
248+
│ │ ├── useModel.ts # Model operations hook
249+
│ │ ├── useVcs.ts # VCS operations hook
250+
│ │ └── useCli.ts # CLI interaction hook
251+
│ └── types/
252+
│ ├── model.ts # TypeScript model types
253+
│ ├── vcs.ts # VCS types
254+
│ └── api.ts # API response types
255+
256+
├── src-tauri/ # Tauri backend (Rust)
257+
│ ├── Cargo.toml # Tauri app dependencies
258+
│ ├── tauri.conf.json
259+
│ ├── build.rs
260+
│ ├── icons/
261+
│ └── src/
262+
│ ├── main.rs # Tauri app entry point
263+
│ │
264+
│ ├── commands/ # Tauri commands (exposed to frontend)
265+
│ │ ├── mod.rs
266+
│ │ ├── model_commands.rs # Model operations
267+
│ │ │ # - import_model(path) -> Model
268+
│ │ │ # - parse_e2k(path) -> E2KModel
269+
│ │ │ # - get_model_stats(id) -> Statistics
270+
│ │ │ # - export_model(id, format) -> Result
271+
│ │ ├── vcs_commands.rs # Version control
272+
│ │ │ # - init_repository(path) -> Result
273+
│ │ │ # - commit_model(message, model) -> Commit
274+
│ │ │ # - get_history() -> Vec<Commit>
275+
│ │ │ # - checkout(commit_id) -> Model
276+
│ │ │ # - diff(commit1, commit2) -> Diff
277+
│ │ │ # - create_branch(name) -> Result
278+
│ │ ├── cli_commands.rs # EtabSharp CLI bridge
279+
│ │ │ # - execute_cli(args) -> CliOutput
280+
│ │ │ # - get_cli_version() -> String
281+
│ │ │ # - convert_to_json(e2k_path) -> JsonPath
282+
│ │ └── validation_commands.rs # Model validation
283+
│ │ # - validate_model(model) -> ValidationReport
284+
│ │ # - check_references() -> Vec<Error>
285+
│ │
286+
│ ├── services/ # Business logic layer
287+
│ │ ├── mod.rs
288+
│ │ ├── model_service.rs # Model management service
289+
│ │ │ # - load_model(path) -> Result<Model>
290+
│ │ │ # - save_model(model) -> Result<()>
291+
│ │ │ # - calculate_statistics(model) -> Stats
292+
│ │ ├── cli_service.rs # CLI spawning/communication
293+
│ │ │ # - spawn_cli(command) -> ChildProcess
294+
│ │ │ # - parse_cli_output(output) -> Result
295+
│ │ │ # - check_cli_available() -> bool
296+
│ │ ├── git_service.rs # Git operations (using git2)
297+
│ │ │ # - init_repo(path) -> Repository
298+
│ │ │ # - create_commit(repo, msg) -> Oid
299+
│ │ │ # - get_commits(repo) -> Vec<Commit>
300+
│ │ │ # - checkout_commit(repo, id) -> Result
301+
│ │ │ # - create_diff(old, new) -> Diff
302+
│ │ ├── storage_service.rs # Database operations
303+
│ │ │ # - save_snapshot(model) -> Result<i64>
304+
│ │ │ # - get_snapshot(id) -> Snapshot
305+
│ │ │ # - list_snapshots() -> Vec<Snapshot>
306+
│ │ └── diff_service.rs # Model comparison
307+
│ │ # - compare_models(m1, m2) -> ModelDiff
308+
│ │ # - detect_changes(old, new) -> ChangeSet
309+
│ │
310+
│ ├── models/ # Data structures
311+
│ │ ├── mod.rs
312+
│ │ ├── snapshot.rs # ModelSnapshot struct
313+
│ │ ├── commit.rs # Commit metadata
314+
│ │ ├── diff.rs # Diff structures
315+
│ │ └── stats.rs # Statistics structures
316+
│ │
317+
│ ├── db/ # Database layer
318+
│ │ ├── mod.rs
319+
│ │ ├── schema.rs # SQLx schema definitions
320+
│ │ ├── connection.rs # DB connection pool
321+
│ │ └── migrations/ # SQL migration files
322+
│ │ ├── 001_init.sql
323+
│ │ ├── 002_add_snapshots.sql
324+
│ │ └── 003_add_commits.sql
325+
│ │
326+
│ ├── utils/ # Utility functions
327+
│ │ ├── mod.rs
328+
│ │ ├── file_utils.rs # File operations
329+
│ │ └── error_utils.rs # Error handling
330+
│ │
331+
│ └── error.rs # Application error types
332+
333+
├── e2k-parser/ # ⭐ SEPARATE LIBRARY CRATE
334+
│ ├── Cargo.toml
335+
│ ├── README.md
336+
│ ├── LICENSE
337+
│ ├── src/
338+
│ │ ├── lib.rs # Library entry point
339+
│ │ │
340+
│ │ ├── parser/ # Parser implementation
341+
│ │ │ ├── mod.rs # Main parser orchestrator
342+
│ │ │ ├── primitives.rs # Basic parsers (number, string, etc.)
343+
│ │ │ ├── sections/ # Section-specific parsers
344+
│ │ │ │ ├── mod.rs
345+
│ │ │ │ ├── file_info.rs # Parse file metadata
346+
│ │ │ │ ├── program_info.rs # Parse program info
347+
│ │ │ │ ├── controls.rs # Parse CONTROLS section
348+
│ │ │ │ ├── stories.rs # Parse STORIES section
349+
│ │ │ │ ├── grids.rs # Parse GRIDS section
350+
│ │ │ │ ├── materials.rs # Parse MATERIAL PROPERTIES
351+
│ │ │ │ ├── rebar_defs.rs # Parse REBAR DEFINITIONS
352+
│ │ │ │ ├── frame_sections.rs # Parse FRAME SECTIONS
353+
│ │ │ │ ├── concrete_sections.rs # Parse CONCRETE SECTIONS
354+
│ │ │ │ ├── shell_props.rs # Parse SLAB/WALL PROPERTIES
355+
│ │ │ │ ├── points.rs # Parse POINT COORDINATES
356+
│ │ │ │ ├── lines.rs # Parse LINE CONNECTIVITIES
357+
│ │ │ │ ├── areas.rs # Parse AREA CONNECTIVITIES
358+
│ │ │ │ ├── assignments.rs # Parse ASSIGNS sections
359+
│ │ │ │ ├── loads.rs # Parse LOAD PATTERNS
360+
│ │ │ │ ├── load_cases.rs # Parse LOAD CASES
361+
│ │ │ │ ├── combinations.rs # Parse LOAD COMBINATIONS
362+
│ │ │ │ └── preferences.rs # Parse DESIGN PREFERENCES
363+
│ │ │ └── utils.rs # Parser utilities
364+
│ │ │
365+
│ │ ├── model/ # Domain model
366+
│ │ │ ├── mod.rs # E2KModel struct
367+
│ │ │ ├── core.rs # Core model structures
368+
│ │ │ ├── geometry/ # Geometry structures
369+
│ │ │ │ ├── mod.rs
370+
│ │ │ │ ├── point.rs # Point struct + methods
371+
│ │ │ │ ├── line.rs # Line struct + methods
372+
│ │ │ │ ├── area.rs # Area struct + methods
373+
│ │ │ │ └── grid.rs # Grid struct
374+
│ │ │ ├── structural/ # Structural elements
375+
│ │ │ │ ├── mod.rs
376+
│ │ │ │ ├── story.rs # Story struct
377+
│ │ │ │ ├── material.rs # Material struct
378+
│ │ │ │ ├── section.rs # Section structs
379+
│ │ │ │ └── property.rs # Properties
380+
│ │ │ ├── loading/ # Load structures
381+
│ │ │ │ ├── mod.rs
382+
│ │ │ │ ├── pattern.rs # LoadPattern
383+
│ │ │ │ ├── case.rs # LoadCase
384+
│ │ │ │ └── combination.rs # LoadCombination
385+
│ │ │ └── design/ # Design data
386+
│ │ │ ├── mod.rs
387+
│ │ │ └── preferences.rs # Design preferences
388+
│ │ │
389+
│ │ ├── validation/ # Validation system
390+
│ │ │ ├── mod.rs # Validator struct
391+
│ │ │ ├── rules/ # Validation rules
392+
│ │ │ │ ├── mod.rs
393+
│ │ │ │ ├── required_sections.rs # Check required sections
394+
│ │ │ │ ├── reference_integrity.rs # Check point/line refs
395+
│ │ │ │ └── geometry_validity.rs # Check geometric validity
396+
│ │ │ └── report.rs # ValidationReport
397+
│ │ │
398+
│ │ ├── query/ # Query interface
399+
│ │ │ ├── mod.rs # Query builder
400+
│ │ │ ├── builder.rs # Fluent query API
401+
│ │ │ └── filters.rs # Filter functions
402+
│ │ │
403+
│ │ ├── export/ # Export functionality
404+
│ │ │ ├── mod.rs
405+
│ │ │ ├── json.rs # JSON export
406+
│ │ │ └── csv.rs # CSV export
407+
│ │ │
408+
│ │ ├── error.rs # Error types
409+
│ │ └── prelude.rs # Common imports
410+
│ │
411+
│ ├── tests/
412+
│ │ ├── integration_tests.rs
413+
│ │ ├── parser_tests.rs
414+
│ │ ├── validation_tests.rs
415+
│ │ └── fixtures/
416+
│ │ ├── sample_simple.e2k
417+
│ │ ├── sample_hotel.e2k
418+
│ │ └── invalid.e2k
419+
│ │
420+
│ ├── benches/
421+
│ │ └── parse_benchmark.rs # Performance benchmarks
422+
│ │
423+
│ └── examples/
424+
│ ├── basic_parse.rs
425+
│ ├── validate_model.rs
426+
│ └── export_json.rs
427+
428+
├── EtabExtension.CLI/ # C# CLI (already exists)
429+
│ └── ... (your existing C# project)
430+
431+
└── docs/
432+
├── architecture.md
433+
├── api.md
434+
└── development.md
205435
```

src/EtabSharp/EtabSharp.csproj

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
<!-- Package Identity -->
99
<Title>EtabSharp</Title>
1010
<PackageId>EtabSharp</PackageId>
11-
<Version>0.1.2-beta</Version>
11+
<Version>0.2.0-beta</Version>
1212
<Copyright>Copyright © Thanh Tu 2025</Copyright>
1313
<Authors>Thanh Tu</Authors>
1414

1515
<!-- Package Description -->
16-
<Description>The easiest way to use the Etabs API in .NET</Description>
16+
<Description>The easiest way to use the ETABS API in .NET. Automatically detects and references your ETABS installation - no manual setup required!</Description>
1717
<PackageTags>etabs;structural-engineering;civil-engineering;structural-analysis;csi;etabs-api;building-design;structural-design</PackageTags>
1818

1919
<!-- Repository & Documentation -->
@@ -29,9 +29,16 @@
2929

3030
<!-- Package Release Notes -->
3131
<PackageReleaseNotes>
32-
v0.1.2-beta - ETABSv1.dll now included in package
32+
v0.2.0-beta - Auto-Detection Release 🚀
3333

34-
✨ NEW: ETABSv1.dll automatically included - no manual setup required!
34+
✨ BREAKING CHANGE: ETABSv1.dll is NO LONGER shipped in package
35+
36+
🎯 NEW: Automatic ETABS installation detection!
37+
- Zero configuration required
38+
- Works with ETABS 21 and 22 and beyond
39+
- Automatically finds and references your ETABS installation
40+
- Supports both 64-bit and 32-bit installations
41+
- Much smaller package size (~99% reduction)
3542

3643
Features:
3744
- Material property management (Concrete, Rebar, Steel)
@@ -44,9 +51,14 @@
4451
- Full IntelliSense support
4552

4653
Requirements:
47-
- ETABS v22+ must be installed (for COM API functionality)
54+
- ETABS v21+ must be installed on your system
4855
- .NET 10.0 or later
4956
- Windows OS
57+
58+
Migration from v0.1.x:
59+
- Simply update the package - no code changes needed
60+
- ETABS will be auto-detected from standard installation paths
61+
- If custom path needed, set ETABS_INSTALL_DIR environment variable
5062
</PackageReleaseNotes>
5163

5264
<!-- CI/CD Settings -->
@@ -55,33 +67,60 @@
5567
<PublishRepositoryUrl>true</PublishRepositoryUrl>
5668
</PropertyGroup>
5769

70+
<!-- =========================
71+
Package Dependencies
72+
========================= -->
5873
<ItemGroup>
5974
<PackageReference Include="Microsoft.Extensions.Logging" />
6075
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
6176
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
6277
</ItemGroup>
6378

64-
<ItemGroup>
65-
<Reference Include="ETABSv1">
66-
<HintPath>..\..\lib\ETABSv1.dll</HintPath>
67-
<Private>True</Private>
68-
</Reference>
79+
<!-- =========================
80+
Development-only ETABS Reference
81+
(Only used when building the library itself)
82+
========================= -->
83+
<PropertyGroup>
84+
<!-- Detect ETABS installation for development -->
85+
<EtabsDevPath Condition="Exists('$(MSBuildThisFileDirectory)..\..\lib\ETABSv1.dll')">$(MSBuildThisFileDirectory)..\..\lib\ETABSv1.dll</EtabsDevPath>
86+
<EtabsDevPath Condition="'$(EtabsDevPath)' == '' AND Exists('C:\Program Files\Computers and Structures\ETABS 22\ETABSv1.dll')">C:\Program Files\Computers and Structures\ETABS 22\ETABSv1.dll</EtabsDevPath>
87+
<EtabsDevPath Condition="'$(EtabsDevPath)' == '' AND Exists('C:\Program Files (x86)\Computers and Structures\ETABS 22\ETABSv1.dll')">C:\Program Files (x86)\Computers and Structures\ETABS 22\ETABSv1.dll</EtabsDevPath>
88+
</PropertyGroup>
89+
90+
<ItemGroup Condition="'$(EtabsDevPath)' != ''">
91+
<Reference Include="ETABSv1">
92+
<HintPath>$(EtabsDevPath)</HintPath>
93+
<!--
94+
Private=false because:
95+
1. This is a CLASS LIBRARY - it doesn't need ETABSv1.dll in its output
96+
2. The library doesn't ship with ETABSv1.dll
97+
3. Consuming applications get ETABSv1.dll via the .targets file
98+
-->
99+
<Private>false</Private>
100+
<EmbedInteropTypes>false</EmbedInteropTypes>
101+
</Reference>
69102
</ItemGroup>
70103

71-
<ItemGroup>
72-
<!-- Package the DLL in lib folder so it's copied to consuming projects -->
73-
<None Include="..\..\lib\ETABSv1.dll" Pack="true" PackagePath="lib\net10.0\" />
104+
<!-- Show ETABS path during development build -->
105+
<Target Name="ShowEtabsDevPath" BeforeTargets="CoreCompile">
106+
<Message Text="[EtabSharp.csproj] ETABS dev reference: $(EtabsDevPath)" Importance="high" Condition="'$(EtabsDevPath)' != ''" />
107+
<Warning Text="[EtabSharp.csproj] ETABS not found - build may fail. Install ETABS or place ETABSv1.dll in lib\ folder." Condition="'$(EtabsDevPath)' == ''" />
108+
</Target>
74109

75-
<!-- Also include in runtimes for native reference -->
76-
<None Include="..\..\lib\ETABSv1.dll" Pack="true" PackagePath="runtimes\win-x64\native\" />
77-
<None Include="..\..\lib\ETABSv1.dll" Pack="true" PackagePath="runtimes\win-arm64\native\" />
110+
<!-- =========================
111+
Package Content
112+
========================= -->
113+
<ItemGroup>
114+
<!-- Include the .targets file for auto-detection -->
115+
<None Include="build\EtabSharp.targets" Pack="true" PackagePath="build\EtabSharp.targets" />
116+
<None Include="build\EtabSharp.targets" Pack="true" PackagePath="buildTransitive\EtabSharp.targets" />
78117

79118
<!-- Include README -->
80119
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
81120

82-
<!-- Include .targets file to auto-reference ETABSv1.dll in consuming projects -->
83121
</ItemGroup>
84122

85-
123+
124+
86125

87126
</Project>

0 commit comments

Comments
 (0)