Cadmai.Poi3dPlugin.WinFormsControl
1.0.1
dotnet add package Cadmai.Poi3dPlugin.WinFormsControl --version 1.0.1
NuGet\Install-Package Cadmai.Poi3dPlugin.WinFormsControl -Version 1.0.1
<PackageReference Include="Cadmai.Poi3dPlugin.WinFormsControl" Version="1.0.1" />
paket add Cadmai.Poi3dPlugin.WinFormsControl --version 1.0.1
#r "nuget: Cadmai.Poi3dPlugin.WinFormsControl, 1.0.1"
// Install Cadmai.Poi3dPlugin.WinFormsControl as a Cake Addin #addin nuget:?package=Cadmai.Poi3dPlugin.WinFormsControl&version=1.0.1 // Install Cadmai.Poi3dPlugin.WinFormsControl as a Cake Tool #tool nuget:?package=Cadmai.Poi3dPlugin.WinFormsControl&version=1.0.1
Poi3D Nuget Packages
Introduction
The Poi3D Nuget packages include .Net Framework controls which are used to embed the Poi3D collaboration portal into Windows based client applications (more information about the Poi3D portal can be found at https://poi3d.com).
These Poi3D controls allow documents, whether in the form of 2D files or 3D models, to be viewed and supplemented with attachments.
For example, annotations can be added to PDF or image files, or sensor data, such as from home automation, can be displayed. In the 3D domain, surfaces can be designed, instructions defined, and bill of materials created. The software also supports Augmented Reality (AR) and Virtual Reality (VR), allowing viewer positions to be saved.
All defined attachments can be stored parallel to the document, ensuring that the original document remains unchanged.
The Poi3D controls provides their functionality both locally on the computer and via the web. This is achieved by embedding a web browser, which displays the portal version of Poi3D, within the Poi3D controls, allowing communication between the two. The corresponding portal URL can be set via a property, allowing self-hosted Poi3D portals to be integrated into the client.
The Poi3D controls also support the conversion of 3D standard formats like JT, STEP, STL, OBJ, GLB, or GLTF into a format which can be displayed in the web browser.
Functional information
Local file operations
In local mode, the user is not logged into the portal. While they use the functions of the embedded web portal, all attachments are passed to the client application and are not sent to the server.
Web operations
When the user is logged in and a local file is open, it can be saved in the portal and shared with other portal users. This is done through the save dialog, which is accessed via the "Save to Portal" command in the portal menu.
Once the document is saved in the portal, it can then be made available to other users via workgroups. Additionally, further files can be attached to the document. If attachments to portal documents which were sent from the client application are created or modified, these changes will be passed to the client application as well.
Programming information
Environment
The Poi3D controls use the .Net Framework 4.7.2 and the C++ runtime 14.0 under 64 bit. The runtime can be downloaded from https://aka.ms/vs/17/release/vc_redist.x64.exe
Downloads
The controls can be downloaded from https://www.nuget.org (Cadmai.Poi3dPlugin.WinFormsControl or Cadmai.Poi3dPlugin.WpfControl)
Embedding
After the Nuget package is installed, the embedded Poi3dPortalControl can be dragged into a Windows/WPF Form.
Communication
The communication between the client and the Poi3D control is established by using methods provided from the Poi3D control and reacting to events sent by the Poi3D control. To handle events from the portal just add an even handler to the Poi3dControlEvent provided by the Poi3D control.
How to initialize the portal
public Form1()
{
InitializeComponent();
poi3dPortalControl1.PortalUrl = "https://demo.mypoi3d.com/Poi3dViewer.html";
// default is https://portal.poi3d.com/Poi3dViewer.html
poi3dPortalControl1.PortalColor = Poi3dPortalColor.Light;
poi3dPortalControl1.PortalLanguage = Poi3dPortalLanguage.English;
poi3dPortalControl1.OpenPortalWebSite();
}
How to convert/open a local file
private void openLocalFileMenuItem_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "All Files|*.wpm;*.obj;*.stl;*.3ds;*.glb;*.gltf;*.stp;*.step;*.jt;*.3dxml;*.jpg;*.png;*.tif;*.bmp;*.svg;*.gif;*.pdf|" +
"3D Mesh Files (*.wpm;*.obj;*.stl;*.3ds;*.glb;*.gltf)|*.wpm;*.obj;*.stl;*.3ds;*.glb;*.gltf|" +
"3D CAD Files (*.stp;*.step;*.jt;*.3dxml)|*.stp;*.step;*.jt;*.3dxml|" +
"Image Files (*.jpg;*.png;*.tif;*.bmp;*.svg;*.gif)|*.jpg;*.png;*.tif;*.bmp;*.svg;*.gif|" +
"2D Documents (*.pdf)|*.pdf";
openFileDialog.FilterIndex = 1;
openFileDialog.Multiselect = false;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
string inputFileName = openFileDialog.FileName;
string extension = Path.GetExtension(inputFileName).ToLower();
switch (extension)
{
case ".obj":
case ".stl":
case ".3ds":
case ".glb":
case ".gltf":
case ".3dxml":
case ".jt":
case ".step":
case ".stp":
poi3dPortalControl1.Convert3dModel(inputFileName);
break;
case ".wpm":
case ".jpg":
case ".png":
case ".bmp":
case ".svg":
case ".gif":
case ".tif":
case ".pdf":
poi3dPortalControl1.OpenLeftDocumentFromFile(inputFileName, "");
break;
}
}
}
}
How to receive information from the portal
private async void poi3dPortalControl1_Poi3dControlEvent(object sender, Poi3dControlEventArgs args)
{
switch (args.EventType)
{
case Poi3dPortalEvents.AnnotationsSaved:
string annotations = await poi3dPortalControl1.GetDocumentAnnotations();
//-> save the annotations
break;
case Poi3dPortalEvents.AnnotationsRequested:
//-> read and send the annotations
string annotationString = "[]";
Poi3dMessage result = await poi3dPortalControl1.SetDocumentAnnotations(annotationString);
break;
case Poi3dPortalEvents.ModelConverted:
string fullFileNameToLoad = args.Info;
//-> open the model
poi3dPortalControl1.OpenLeftDocumentFromFile(fullFileNameToLoad, "");
break;
}
}
Misc
To avoid DPI switching (e.g. after model conversion) just use the DpiAware.manifest for your application which is inserted into the development project.
Licensing
Poi3D controls, licensed under the MIT license, use external libraries like the Microsoft WebView2 control or OpenCASCADE libraries for 3D model conversion. The license information is stored in the docs folder of the package.
As a default, the Poi3D portal https://portal.poi3d.com is referenced, which can be used freely. If you want to use or host your own Poi3D portal instance please find more information at https://mypoi3d.com/Hosting.html
Disclaimer
Copyright CADMAI Software GmbH. All rights reserved.
The redistributor / user does not have the right to change, translate, back-develop, decompile or disassemble the software.
Redistributions must retain the above copyright notice, this list of conditions and the following disclaimer.
Neither the name of CADMAI Software GmbH nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.1 | 67 | 1/28/2025 |
Initial release