diff --git a/FemDesign.Examples/Python/FemDesign.Core.dll b/FemDesign.Examples/Python/FemDesign.Core.dll deleted file mode 100644 index 4fe0b3bd..00000000 Binary files a/FemDesign.Examples/Python/FemDesign.Core.dll and /dev/null differ diff --git a/FemDesign.Examples/Python/FuzzySharp.dll b/FemDesign.Examples/Python/FuzzySharp.dll deleted file mode 100644 index f50ebb55..00000000 Binary files a/FemDesign.Examples/Python/FuzzySharp.dll and /dev/null differ diff --git a/FemDesign.Examples/Python/Newtonsoft.Json.dll b/FemDesign.Examples/Python/Newtonsoft.Json.dll deleted file mode 100644 index b7c65969..00000000 Binary files a/FemDesign.Examples/Python/Newtonsoft.Json.dll and /dev/null differ diff --git a/FemDesign.Examples/Python/using_pythonnet.py b/FemDesign.Examples/Python/using_pythonnet.py deleted file mode 100644 index 97c719a4..00000000 --- a/FemDesign.Examples/Python/using_pythonnet.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -FemDesign API (C#) from python using Python.NET (clr) -Date: 2024-02-027 -API: 23.0.1 -Authors: Alexander Radne - @xRadne, Marco Pellegrino - @Marco-Pellegrino -Github: https://github.com/strusoft/femdesign-api - -Documentation at https://www.fuget.org/packages/FemDesign.Core -Read more about Python.NET (clr) at http://pythonnet.github.io/ -""" - -import os, sys, clr, math -import pandas as pd -import numpy as np - -clr.AddReference("FemDesign.Core") -import FemDesign -import FemDesign.Bars -import FemDesign.Calculate -import FemDesign.Results - - - -# Create a new model with country specified -model = FemDesign.Model(country= FemDesign.Country.S) - - -# Import List from .NET -clr.AddReference("System.Collections") -from System.Collections.Generic import List - -# Add elements to model -points = List[FemDesign.Geometry.Point3d]() -for i in range(11): - x = float(i) - y = 0.0 - z = math.cos(2 * math.pi * i / 10) + 2 - p = FemDesign.Geometry.Point3d(x, y, z) - points.Add(p) - -beamtype = FemDesign.Bars.BarType.Beam -materialDB = FemDesign.Materials.MaterialDatabase.GetDefault() -material = materialDB.MaterialByName("S355") -sectionDB = FemDesign.Sections.SectionDatabase.GetDefault() -section = sectionDB.SectionByName("Steel sections, UKB, 127x76x13") - -_section = List[FemDesign.Sections.Section]() -_section.Add(section) - -connectivity = List[FemDesign.Bars.Connectivity]() -connectivity.Add(FemDesign.Bars.Connectivity.Default) - -eccentricity = List[FemDesign.Bars.Eccentricity]() -eccentricity.Add(FemDesign.Bars.Eccentricity.Default) - -bars = List[FemDesign.Bars.Bar]() -for i in range(points.Count - 1): - p1, p2 = points[i], points[i + 1] - line = FemDesign.Geometry.Edge(p1, p2, FemDesign.Geometry.Vector3d.UnitY) - bar = FemDesign.Bars.Beam(line, material, _section.ToArray(), eccentricity.ToArray(), connectivity.ToArray(), f"B.{i+1}") - bar.BarPart.OrientCoordinateSystemToGCS() - bars.Add(bar) - -model.AddElements[FemDesign.Bars.Bar](bars) - -# Add supports to mode -supports = List[FemDesign.Supports.PointSupport]() - -point = points[0] -vector1 = FemDesign.Geometry.Vector3d(1,0,0) -vector2 = FemDesign.Geometry.Vector3d(0,1,0) -plane = FemDesign.Geometry.Plane(point, vector1, vector2) - -support1 = FemDesign.Supports.PointSupport.Rigid(plane) - -supports.Add(support1) - -model.AddElements[FemDesign.Supports.PointSupport](supports) - -# Add loadcases to model -loadcases = List[FemDesign.Loads.LoadCase]() - -LC1 = FemDesign.Loads.LoadCase("LC1", FemDesign.Loads.LoadCaseType.DeadLoad, FemDesign.Loads.LoadCaseDuration.Permanent) -loadcases.Add(LC1) -LC2 = FemDesign.Loads.LoadCase("LC2", FemDesign.Loads.LoadCaseType.Static, FemDesign.Loads.LoadCaseDuration.Permanent) -loadcases.Add(LC2) - -model.AddLoadCases(loadcases) - -# Add loads to model -loads = List[FemDesign.GenericClasses.ILoadElement]() -p1 = points[5] -v1 = FemDesign.Geometry.Vector3d(0.0, 0.0, -5.0) -load = FemDesign.Loads.PointLoad(p1, v1, LC2, "", FemDesign.Loads.ForceLoadType.Force) -loads.Add(load) - -model.AddLoads[FemDesign.GenericClasses.ILoadElement](loads) - - -# Establish a Live Link connection in FemDesign -femdesign = FemDesign.FemDesignConnection(keepOpen = True) - -# Open a Model -femdesign.Open(model) - -# Run an Analysis -analysis = FemDesign.Calculate.Analysis(calcCase= True, calcComb= False) -femdesign.RunAnalysis(analysis) - -# Read Results -bar_displacements = femdesign.GetResults[FemDesign.Results.BarDisplacement]() -node_displacements = femdesign.GetResults[FemDesign.Results.NodalDisplacement]() -support_reactions = femdesign.GetLoadCaseResults[FemDesign.Results.PointSupportReaction](LC1.Name) - - -# Disconnect the Live Link Connection -femdesign.Disconnect() - -print("BARS DISPLACEMENT") -for obj in bar_displacements: - print(f"Pos: {obj.Pos} - Ez: {obj.Ez} m, LoadCase: {obj.CaseIdentifier}") - -print("") -print("NODES DISPLACEMENT") -for obj in node_displacements: - print(f"NodeId: {obj.NodeId} - Ez: {obj.Ez} m, LoadCase: {obj.CaseIdentifier}") - -print("") -print("REACTION FORCES") -for obj in support_reactions: - print(f"NodeId: {obj.NodeId} - Fz: {obj.Fz} kN, LoadCase: {obj.CaseIdentifier}") \ No newline at end of file diff --git a/FemDesign.Examples/README.md b/FemDesign.Examples/README.md index 710c78e7..e37f5dfb 100644 --- a/FemDesign.Examples/README.md +++ b/FemDesign.Examples/README.md @@ -23,16 +23,11 @@ With Dynamo installed, any of the Dynamo examples are ready to run. Download an The examples are ready to run out-of-the-box, but you might have to set a file path or file name. You'll know either from instructions in the file, or because some components give an error. ### 🐍 Python -The python example folder contains an example (`using_pythonnet.py`) on how to run the C# (`FemDesign.Core`) API from Python. This example uses the python package Python.NET (clr) (http://pythonnet.github.io/). - -**NOTE**: A complete Python wrapper is [planned in the future](https://github.com/strusoft/femdesign-api/issues/221), but pythonnet can be used already today to access all of the functionality of the C# API. - -The example have been tested using -- IronPython 2.7 (pythonnet pre-installed) -- CPython 3.7 (with [pip package pythonnet](https://pypi.org/project/pythonnet/)) +`pip install FEM-Design` to install the library and any of the python examples are ready to run. ## Maintenance -The examples and samples here are created and mainatained by StruSoft. +The examples and samples here are created and maintained by StruSoft. + ## Questions and feedback If you have any questions regarding the examples and how they work, feel free to contact us. We also welcome any feedback, as well as suggestions for future examples. You can reach us at support@strusoft.freshdesk.com or at https://strusoft.freshdesk.com/en/support/tickets/new. diff --git a/README.md b/README.md index 36e57476..04854613 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,10 @@ [![NuGet Downloads](https://img.shields.io/nuget/dt/FemDesign.Core)](https://www.nuget.org/packages/FemDesign.Core) - - # femdesign-api This repository contains source code for the FEM-Design API wrapper. It consists of the `C#`-Core together with the `Dynamo` and `Grasshopper` plugins. ## πŸš— Road-map - https://github.com/strusoft/femdesign-api/milestones ## Installation @@ -28,6 +25,9 @@ Either - Download the grasshopper package with [Package Manager](https://femdesign-api-docs.onstrusoft.com/docs/grasshopper/get-started/#installation) - Or download it manually by downloading `FemDesign.Grasshopper.zip` from [latest release](https://github.com/strusoft/femdesign-api/releases/latest), unblock the file and unzip to the grasshopper libraries folder (e.g `C:\Users\USERNAME\AppData\Roaming\Grasshopper\Libraries`). +### 🐍 Python +There are multiple ways to install Python, but one of them is to download the installer from [Python.org](https://www.python.org/downloads/). + ### πŸ€– Dynamo (Deprecated) Either - Install it from within Dynamo using Online Package Search. Search for `FemDesign`. (Guide on [installing dynamo package](https://www.dynamonow.com/downloading-installing-packages/)) @@ -35,9 +35,6 @@ Either _**NOTE:** The Dynamo package is no longer being actively maintained, and the most recently tested version is 21.6.0._ -### 🐍 Python -There are multiple ways to install Python, but one of them is to download the installer from [Python.org](https://www.python.org/downloads/). - ## Examples Examples can be found in the folder [FemDesign.Examples/](https://github.com/strusoft/femdesign-api/tree/master/FemDesign.Examples). More examples are planned to be added in the future. @@ -45,14 +42,14 @@ Examples can be found in the folder [FemDesign.Examples/](https://github.com/str [FEM-Design API docs](https://femdesign-api-docs.onstrusoft.com) ## Contributing -Feel free to fork this repo as you seem fit. Please let us know with an issue what feature you want and how you plan on implement it and we (the [authors](#Authors)) will guide you. +Feel free to fork this repo as you seem fit. Please let us know with an issue what feature you want and how you plan on implement it and we (the [authors](#Authors)) will guide you. If you want to contribute please follow our [contribution guide](https://github.com/strusoft/femdesign-api/wiki/Contribute). ## Versioning Future versioning will be using the following structure: `major.minor.patch` where major follows the FEM-Design version. ## Authors -The FEM-Design API repository is developed and maintained by [StruSoft](https://strusoft.com/). +The FEM-Design API repository is developed and maintained by [StruSoft](https://strusoft.com/). ## Disclaimer In addition to the disclaimer under the license ([LICENSE.md](LICENSE)) - All files and related documentation is for illustrative and educational purposes and may not interact with FEM-Design in a reliable way depending on your version, installation and content of the files. Furthermore, Strusoft wonΒ΄t guarantee full support of the package. 😊