diff --git a/Plugin.csproj b/Plugin.csproj deleted file mode 100644 index 417437a..0000000 --- a/Plugin.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - Designer - MSBuild:Compile - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - Designer - MSBuild:Compile - - - - \ No newline at end of file diff --git a/SimpleTestPlugin.csproj b/SimpleTestPlugin.csproj deleted file mode 100644 index 49cf663..0000000 --- a/SimpleTestPlugin.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - Debug - AnyCPU - {1A0124F6-3DEB-4153-8760-F568AD9393EE} - Library - Properties - NavisworksTransport - SimpleTestPlugin - v4.8 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE;NAVISWORKS_2026 - prompt - 4 - x64 - - - - pdbonly - true - bin\Release\ - TRACE;NAVISWORKS_2026 - prompt - 4 - - - - - - ..\..\..\..\Program Files\Autodesk\Navisworks Manage 2026\Autodesk.Navisworks.Api.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - NavisworksTransport.Tian.name.txt - - - - - - - - \ No newline at end of file diff --git a/VERSION.md b/VERSION.md index 8adc70f..a3df0a6 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -0.8.0 \ No newline at end of file +0.8.0 diff --git a/WARP.md b/WARP.md index 8804129..2a0b9a6 100644 --- a/WARP.md +++ b/WARP.md @@ -9,16 +9,19 @@ NavisworksTransport is a comprehensive Navisworks 2026 plugin for logistics path ## Common Development Commands ### Building + - **Primary build command**: `./compile.bat` - Must use `./` prefix in PowerShell/CMD on Windows - **Alternative**: `dotnet build NavisworksTransportPlugin.csproj --configuration Debug --verbosity normal` - **MSBuild paths auto-detected**: VS2022 Community → Professional → VS2019 fallback ### Deployment + - **Deploy to Navisworks**: `deploy-plugin.bat` (requires Administrator privileges) - **Auto-deployment**: Build output automatically copies to Navisworks 2026 plugin directory - **Plugin location**: `C:\Program Files\Autodesk\Navisworks Manage 2026\Plugins\NavisworksTransportPlugin\` ### Testing & Debugging + - **Log viewer**: Use LogManager centralized logging - logs stored in `%CommonApplicationData%\Autodesk\Navisworks Manage 2026\NavisworksTransport\logs\debug.log` - **Hot reload**: Restart Navisworks required after each compilation - **Testing environment**: Navisworks Manage 2026 exclusively @@ -26,6 +29,7 @@ NavisworksTransport is a comprehensive Navisworks 2026 plugin for logistics path ## Architecture Overview ### Dual Plugin Architecture Pattern + This system implements multiple Navisworks plugin types in a single assembly: - **MainPlugin.cs**: Primary AddInPlugin with ribbon UI integration and DockPanePlugin capabilities @@ -34,6 +38,7 @@ This system implements multiple Navisworks plugin types in a single assembly: - **TestPlugin.cs**: Development testing plugin (separate from main functionality) ### Core Management Layer + - **PathPlanningManager.cs**: Central coordinator with A* pathfinding algorithm integration (RoyT.AStar library) - **LogisticsAnimationManager.cs**: Advanced animation system leveraging Navisworks 2026 native components - **TimeLinerIntegrationManager.cs**: Bridge between custom animations and Navisworks TimeLiner @@ -42,6 +47,7 @@ This system implements multiple Navisworks plugin types in a single assembly: - **ModelSplitterManager.cs**: Model export and layer separation capabilities ### Data & Coordinate Systems + - **PathPlanningModels.cs**: Core data structures with event-driven state management - **PathDataManager.cs**: JSON serialization system with migration support - **CoordinateConverter.cs**: Complex coordinate transformation chains for 2D map overlay to 3D world mapping @@ -49,6 +55,7 @@ This system implements multiple Navisworks plugin types in a single assembly: - **FloorDetector.cs**: Multi-story building automatic floor/level detection ### UI Architecture: Hybrid WPF + WinForms + - **WPF Components** (`src\UI\WPF\`): Modern MVVM-based controls - LogisticsControlPanel: Main docked interface panel - ViewModels: INotifyPropertyChanged pattern implementation @@ -57,6 +64,7 @@ This system implements multiple Navisworks plugin types in a single assembly: - **Integration**: ElementHost pattern for embedding WPF in Navisworks environment ### Pathfinding & Animation Integration + - **A* Implementation**: RoyT.AStar library for optimal path calculation - **Animation Pipeline**: Transform-based movement with real-time collision detection - **TimeLiner Bridge**: Synchronization between custom path animations and Navisworks timeline @@ -65,34 +73,41 @@ This system implements multiple Navisworks plugin types in a single assembly: ## Technical Implementation Details ### Navisworks API Integration Strategy + - **Dual API Approach**: Native API (`Autodesk.Navisworks.Api`) for core functionality + COM API (`Autodesk.Navisworks.ComApi`) for attribute persistence and TimeLiner operations - **Multi-Plugin Registration**: Three distinct plugin types registered in single assembly - **Global Exception Handling**: `GlobalExceptionHandler` class provides application-wide error management - **Navisworks 2026 Exclusive**: Utilizes 2026-specific API features without backward compatibility constraints ### State Management Architecture + - **Session State**: PathEditState enum (None, AddingPoints, EditingPath) with comprehensive event callbacks - **Data Persistence**: JSON-based serialization with LogisticsAttributeChangedEventArgs for change tracking - **Coordinate Mapping**: Multi-layer coordinate system supporting 2D overlay visualization on 3D models ### Logistics Classification System + Eight predefined categories with automatic inheritance from parent to child nodes: + - 门 (Doors), 电梯 (Elevators), 楼梯 (Stairs), 通道 (Channels) - 障碍物 (Obstacles), 装卸区 (Loading Zones), 停车区 (Parking), 检查点 (Checkpoints) ## Development Guidelines ### Language Standards + - **Primary Language**: 中文 (Chinese) for all user interaction, code comments, and technical documentation - **Communication**: All development discussions and code documentation must be in Chinese ### Package Management (Legacy .NET Framework) + - **Project Format**: Old-style csproj using `` with HintPath (NOT PackageReference) - **NuGet Management**: Manual packages.config management (do NOT use `dotnet add package`) - **Package Installation**: Download .nupkg files and extract to packages/ directory - **Assembly Path Format**: `packages\{PackageId}.{Version}\lib\{TargetFramework}\{Assembly}.dll` ### Plugin Registration Patterns + ```csharp // Multi-plugin registration in single assembly [Plugin("NavisworksTransport.MainPlugin", "YourDeveloperID")] @@ -105,12 +120,14 @@ public class PathClickToolPlugin : ToolPlugin { } ``` ### Critical API Usage Patterns + - **Navisworks API Documentation**: Always check `doc\navisworks_api\` documentation before implementing Navisworks functionality - **COM API for Persistence**: Use COM API for all attribute operations requiring session persistence - **GlobalExceptionHandler**: Must be initialized in MainPlugin constructor for application-wide error handling - **Thread Safety**: All UI operations must be marshaled to main thread when called from background processes ### Navisworks 2026 Development Focus + - **Exclusive 2026 Targeting**: No backward compatibility required - leverage all 2026-specific features - **Legacy References**: `src\Legacy\` contains reference code from 2017 version but is not actively maintained - **Modern Animation System**: Use Navisworks 2026 native animation components instead of manual Transform manipulation @@ -119,17 +136,20 @@ public class PathClickToolPlugin : ToolPlugin { } ## API Documentation Search Strategy ### CHM Documentation Best Practices + **Problem**: CHM extraction creates thousands of HTML files, making standard search tools ineffective **Solution Strategies**: 1. **Use structural entry points**: + ```bash # Priority access to class member lists AllMembers_T_Autodesk_Navisworks_Api_ClassName.htm ``` 2. **Precise filename search**: + ```bash find . -name "*ClassName*" -o -name "*MethodName*" ``` @@ -147,6 +167,7 @@ public class PathClickToolPlugin : ToolPlugin { } ## File Structure Context ### Source Organization + ``` src/ ├── Core/ # Main plugin components @@ -162,12 +183,14 @@ src/ ``` ### Documentation Structure + - `doc/guide/`: Development guides and troubleshooting - `doc/migration/`: 2017→2026 migration documentation - `doc/requirement/`: Requirements and specifications - `doc/working/`: Active development documentation ### Build Configuration + - **Target Framework**: .NET Framework 4.8 (x64 platform) - **Navisworks Version**: 2026 exclusive with conditional compilation (`NAVISWORKS_2026`) - **Key Dependencies**: RoyT.AStar for pathfinding, WPF for modern UI diff --git a/compile-simple.bat b/compile-simple.bat deleted file mode 100644 index 68a00ea..0000000 --- a/compile-simple.bat +++ /dev/null @@ -1,31 +0,0 @@ -@echo off -echo Building Simple WPF Test Plugin... - -REM Set MSBuild path (check Community edition first) -set MSBUILD_PATH="C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" - -REM Check if MSBuild exists, try alternative paths -if not exist %MSBUILD_PATH% ( - set MSBUILD_PATH="C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe" -) -if not exist %MSBUILD_PATH% ( - set MSBUILD_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe" -) -if not exist %MSBUILD_PATH% ( - echo MSBuild not found. Trying dotnet build... - dotnet build NavisworksTransportPlugin.csproj --verbosity minimal - goto :end -) - -echo Using MSBuild: %MSBUILD_PATH% - -REM Build the project -echo Building project... -%MSBUILD_PATH% "SimpleTestPlugin.csproj" /p:Configuration=Debug /p:Platform=AnyCPU /verbosity:minimal - -:end -if %ERRORLEVEL% EQU 0 ( - echo Build successful! -) else ( - echo Build failed! -) \ No newline at end of file diff --git a/src/Core/SimpleWPFHelloWorldControl.cs b/src/Core/SimpleWPFHelloWorldControl.cs deleted file mode 100644 index 2671d09..0000000 --- a/src/Core/SimpleWPFHelloWorldControl.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Windows.Controls; - -namespace NavisworksTransport -{ - /// - /// Interaction logic for UserControl1.xaml - /// - public partial class SimpleWPFHelloWorldControl : UserControl - { - public SimpleWPFHelloWorldControl() - { - InitializeComponent(); - } - - private void InitializeComponent() - { - var textBlock = new TextBlock(); - textBlock.Text = "Hello World from WPF!"; - textBlock.FontSize = 16; - textBlock.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; - textBlock.VerticalAlignment = System.Windows.VerticalAlignment.Center; - - this.Content = textBlock; - } - } -} \ No newline at end of file diff --git a/src/Core/SimpleWPFTestPlugin.cs b/src/Core/SimpleWPFTestPlugin.cs deleted file mode 100644 index f60ef3e..0000000 --- a/src/Core/SimpleWPFTestPlugin.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Windows.Forms.Integration; -using Autodesk.Navisworks.Api.Plugins; - -namespace NavisworksTransport -{ - [Plugin("NavisworksTransport.SimpleWPFTest", "ADSK", - DisplayName = "SimpleWPFTestPlugin", - ToolTip = "Basic WPF Docking Pane Plugin")] - [DockPanePlugin(150, 200, FixedSize=false)] - class SimpleWPFTestPlugin : DockPanePlugin - { - public override System.Windows.Forms.Control CreateControlPane() - { - ElementHost eh = new ElementHost(); - eh.AutoSize = true; - eh.Child = new SimpleWPFHelloWorldControl(); - eh.CreateControl(); - return eh; - } - - public override void DestroyControlPane(System.Windows.Forms.Control pane) - { - pane.Dispose(); - } - } -} \ No newline at end of file diff --git a/test-simple-plugin.bat b/test-simple-plugin.bat deleted file mode 100644 index aa73a58..0000000 --- a/test-simple-plugin.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -echo 正在复制纯净WPF测试插件到Navisworks插件目录... - -if not exist "C:\Program Files\Autodesk\Navisworks Manage 2026\Plugins\SimpleTestPlugin" ( - mkdir "C:\Program Files\Autodesk\Navisworks Manage 2026\Plugins\SimpleTestPlugin" -) - -echo 复制纯净WPF插件DLL... -copy "bin\Debug\SimpleTestPlugin.dll" "C:\Program Files\Autodesk\Navisworks Manage 2026\Plugins\SimpleTestPlugin\" -copy "bin\Debug\SimpleTestPlugin.pdb" "C:\Program Files\Autodesk\Navisworks Manage 2026\Plugins\SimpleTestPlugin\" - -echo 文件复制完成! -echo. -echo 已复制纯净WPF测试插件 (按照官方例子构建): -echo - 插件名称: SimpleWPFTestPlugin -echo - 文件大小: 5KB (最小化版本) -echo - 架构: 双文件结构,完全按照官方例子 -echo. -echo 请启动Navisworks Manage 2026测试这个纯净版本 -echo. -pause \ No newline at end of file