Skip to content

Commit 46a18de

Browse files
Carlos HerreroCarlos Herrero
authored andcommitted
Added 2025 version
1 parent 81ea392 commit 46a18de

135 files changed

Lines changed: 6136 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
3+
<PropertyGroup>
4+
<!-- Force configuration to be debug in case none provided, happens if running from command line: example: dotnet build -->
5+
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
6+
<TeklaVersion Condition="'$(Configuration)' == 'Debug'">2024.0</TeklaVersion>
7+
<!-- Or TeklaStructures Installation path can be used instead -->
8+
<!--TeklaStructuresInstallationPath Condition="'$(Configuration)' == 'Debug'">C:\Program Files\Tekla Structures\2024.0\bin</TeklaStructuresInstallationPath-->
9+
</PropertyGroup>
10+
</Project>
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{A9822657-FA75-4F4D-8F90-70AA1998707D}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>BasicPlugin</RootNamespace>
11+
<AssemblyName>BasicPlugin</AssemblyName>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
<NuGetPackageImportStamp>
16+
</NuGetPackageImportStamp>
17+
<TargetFrameworkProfile />
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>..\BuildDrop\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
37+
<DebugSymbols>true</DebugSymbols>
38+
<OutputPath>bin\x64\Debug\</OutputPath>
39+
<DefineConstants>DEBUG;TRACE</DefineConstants>
40+
<DebugType>full</DebugType>
41+
<PlatformTarget>x64</PlatformTarget>
42+
<LangVersion>7.3</LangVersion>
43+
<ErrorReport>prompt</ErrorReport>
44+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
47+
<OutputPath>bin\x64\Release\</OutputPath>
48+
<DefineConstants>TRACE</DefineConstants>
49+
<Optimize>true</Optimize>
50+
<DebugType>pdbonly</DebugType>
51+
<PlatformTarget>x64</PlatformTarget>
52+
<LangVersion>7.3</LangVersion>
53+
<ErrorReport>prompt</ErrorReport>
54+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
55+
</PropertyGroup>
56+
<ItemGroup>
57+
<Reference Include="Akit5, Version=5.15.0.0, Culture=neutral, PublicKeyToken=a70cba4ef557ee03, processorArchitecture=MSIL">
58+
<HintPath>..\packages\Tekla.Technology.Akit5.5.15.1\lib\net48\Akit5.dll</HintPath>
59+
<EmbedInteropTypes>False</EmbedInteropTypes>
60+
</Reference>
61+
<Reference Include="LibTessDotNet, Version=2.0.0.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
62+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\LibTessDotNet.dll</HintPath>
63+
</Reference>
64+
<Reference Include="Mono.Cecil, Version=0.11.6.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
65+
<HintPath>..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.dll</HintPath>
66+
</Reference>
67+
<Reference Include="Mono.Cecil.Mdb, Version=0.11.6.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
68+
<HintPath>..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
69+
</Reference>
70+
<Reference Include="Mono.Cecil.Pdb, Version=0.11.6.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
71+
<HintPath>..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
72+
</Reference>
73+
<Reference Include="Mono.Cecil.Rocks, Version=0.11.6.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL">
74+
<HintPath>..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
75+
</Reference>
76+
<Reference Include="System" />
77+
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
78+
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
79+
</Reference>
80+
<Reference Include="System.Configuration" />
81+
<Reference Include="System.Core" />
82+
<Reference Include="System.Drawing" />
83+
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
84+
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
85+
</Reference>
86+
<Reference Include="System.Numerics" />
87+
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
88+
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
89+
</Reference>
90+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
91+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
92+
</Reference>
93+
<Reference Include="System.Runtime.Remoting" />
94+
<Reference Include="System.Windows.Forms" />
95+
<Reference Include="System.Xml.Linq" />
96+
<Reference Include="System.Data.DataSetExtensions" />
97+
<Reference Include="Microsoft.CSharp" />
98+
<Reference Include="System.Data" />
99+
<Reference Include="System.Net.Http" />
100+
<Reference Include="System.Xml" />
101+
<Reference Include="Tekla.Common.Geometry, Version=4.6.0.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
102+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\Tekla.Common.Geometry.dll</HintPath>
103+
</Reference>
104+
<Reference Include="Tekla.Common.Geometry.Algorithms, Version=4.6.2.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
105+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\Tekla.Common.Geometry.Algorithms.dll</HintPath>
106+
</Reference>
107+
<Reference Include="Tekla.Common.Geometry.Primitives, Version=4.5.0.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
108+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\Tekla.Common.Geometry.Primitives.dll</HintPath>
109+
</Reference>
110+
<Reference Include="Tekla.Common.Geometry.Shapes, Version=4.6.2.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
111+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\Tekla.Common.Geometry.Shapes.dll</HintPath>
112+
</Reference>
113+
<Reference Include="Tekla.Common.Geometry.Shapes.Tools, Version=4.6.2.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
114+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\Tekla.Common.Geometry.Shapes.Tools.dll</HintPath>
115+
</Reference>
116+
<Reference Include="Tekla.Common.Geometry.Topology, Version=4.6.0.0, Culture=neutral, PublicKeyToken=93c0f7e4f1ca9619, processorArchitecture=MSIL">
117+
<HintPath>..\packages\Tekla.Common.Geometry.4.6.2\lib\net\Tekla.Common.Geometry.Topology.dll</HintPath>
118+
</Reference>
119+
<Reference Include="Tekla.Structures, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114, processorArchitecture=MSIL">
120+
<HintPath>..\packages\Tekla.Structures.2024.0.4\lib\net48\Tekla.Structures.dll</HintPath>
121+
</Reference>
122+
<Reference Include="Tekla.Structures.Catalogs, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114, processorArchitecture=MSIL">
123+
<HintPath>..\packages\Tekla.Structures.Catalogs.2024.0.4\lib\net48\Tekla.Structures.Catalogs.dll</HintPath>
124+
</Reference>
125+
<Reference Include="Tekla.Structures.Datatype, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114, processorArchitecture=MSIL">
126+
<HintPath>..\packages\Tekla.Structures.Datatype.2024.0.4\lib\net48\Tekla.Structures.Datatype.dll</HintPath>
127+
</Reference>
128+
<Reference Include="Tekla.Structures.Dialog, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114, processorArchitecture=MSIL">
129+
<HintPath>..\packages\Tekla.Structures.Dialog.2024.0.4\lib\net48\Tekla.Structures.Dialog.dll</HintPath>
130+
</Reference>
131+
<Reference Include="Tekla.Structures.Model, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114, processorArchitecture=MSIL">
132+
<HintPath>..\packages\Tekla.Structures.Model.2024.0.4\lib\net48\Tekla.Structures.Model.dll</HintPath>
133+
</Reference>
134+
<Reference Include="Tekla.Structures.Plugins, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114, processorArchitecture=MSIL">
135+
<HintPath>..\packages\Tekla.Structures.Plugins.2024.0.4\lib\net48\Tekla.Structures.Plugins.dll</HintPath>
136+
</Reference>
137+
<Reference Include="Tekla.Technology.Scripting.Plugins, Version=5.5.0.0, Culture=neutral, PublicKeyToken=a70cba4ef557ee03, processorArchitecture=MSIL">
138+
<HintPath>..\packages\Tekla.Technology.Scripting.Plugins.5.5.0\lib\netstandard2.0\Tekla.Technology.Scripting.Plugins.dll</HintPath>
139+
</Reference>
140+
<Reference Include="Tekla.Technology.Serialization, Version=4.1.0.0, Culture=neutral, PublicKeyToken=a70cba4ef557ee03, processorArchitecture=MSIL">
141+
<HintPath>..\packages\Tekla.Technology.Serialization.4.1.1\lib\netstandard2.0\Tekla.Technology.Serialization.dll</HintPath>
142+
</Reference>
143+
<Reference Include="Trimble.Remoting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a70cba4ef557ee03, processorArchitecture=MSIL">
144+
<HintPath>..\packages\Trimble.Remoting.1.0.2\lib\netstandard2.0\Trimble.Remoting.dll</HintPath>
145+
</Reference>
146+
<Reference Include="Trimble.Technology.MsgLib, Version=2.2.0.23222, Culture=neutral, PublicKeyToken=a70cba4ef557ee03, processorArchitecture=MSIL">
147+
<HintPath>..\packages\Trimble.Technology.Msglib.2.2.23222\lib\netstandard2.0\Trimble.Technology.MsgLib.dll</HintPath>
148+
</Reference>
149+
<Reference Include="Trimble.Technology.Rkit, Version=2.3.0.23222, Culture=neutral, PublicKeyToken=a70cba4ef557ee03, processorArchitecture=MSIL">
150+
<HintPath>..\packages\Trimble.Technology.Rkit.2.3.23222\lib\netstandard2.0\Trimble.Technology.Rkit.dll</HintPath>
151+
</Reference>
152+
<Reference Include="WindowsBase" />
153+
</ItemGroup>
154+
<ItemGroup>
155+
<Compile Include="BeamPlugin.cs" />
156+
<Compile Include="BeamPluginForm.cs">
157+
<SubType>Form</SubType>
158+
</Compile>
159+
<Compile Include="BeamPluginForm.Designer.cs">
160+
<DependentUpon>BeamPluginForm.cs</DependentUpon>
161+
</Compile>
162+
<Compile Include="Properties\AssemblyInfo.cs" />
163+
</ItemGroup>
164+
<ItemGroup>
165+
<EmbeddedResource Include="BeamPluginForm.resx">
166+
<DependentUpon>BeamPluginForm.cs</DependentUpon>
167+
</EmbeddedResource>
168+
</ItemGroup>
169+
<ItemGroup>
170+
<None Include="app.config" />
171+
<None Include="packages.config" />
172+
</ItemGroup>
173+
<ItemGroup>
174+
<Content Include="Resources\element_catalog_cross_section.bmp" />
175+
<Content Include="Resources\element_catalog_cross_section_sketch.bmp" />
176+
<Content Include="Resources\element_catalog_cross_section_user.bmp" />
177+
<Content Include="Resources\prtyp_tree_1.bmp" />
178+
<Content Include="Resources\prtyp_tree_10.bmp" />
179+
<Content Include="Resources\prtyp_tree_11.bmp" />
180+
<Content Include="Resources\prtyp_tree_13.bmp" />
181+
<Content Include="Resources\prtyp_tree_15.bmp" />
182+
<Content Include="Resources\prtyp_tree_2.bmp" />
183+
<Content Include="Resources\prtyp_tree_3.bmp" />
184+
<Content Include="Resources\prtyp_tree_4.bmp" />
185+
<Content Include="Resources\prtyp_tree_5.bmp" />
186+
<Content Include="Resources\prtyp_tree_6.bmp" />
187+
<Content Include="Resources\prtyp_tree_7.bmp" />
188+
<Content Include="Resources\prtyp_tree_8.bmp" />
189+
<Content Include="Resources\prtyp_tree_9.bmp" />
190+
</ItemGroup>
191+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
192+
</Project>
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
namespace BasicPlugin
2+
{
3+
using System;
4+
using System.Collections;
5+
using System.Collections.Generic;
6+
7+
using Tekla.Structures.Geometry3d;
8+
using Tekla.Structures.Model.UI;
9+
using Tekla.Structures.Plugins;
10+
11+
using TSM = Tekla.Structures.Model;
12+
13+
/// <summary>
14+
/// This class is used for storing data related to the current plugin.
15+
/// </summary>
16+
public class StructuresData
17+
{
18+
/// <summary>
19+
/// The length factor.
20+
/// </summary>
21+
[StructuresField("LengthFactor")]
22+
public double LengthFactor;
23+
24+
/// <summary>
25+
/// The profile.
26+
/// </summary>
27+
[StructuresField("Profile")]
28+
public string Profile;
29+
}
30+
31+
/// <summary>
32+
/// This plugin is similar to the example found in the Open API Reference PluginBase section.
33+
/// The plugin asks the user to pick two points. The plug-in then calculates new insertion points
34+
/// using a double parameter from the dialog and creates a beam.
35+
/// </summary>
36+
[Plugin(PluginName)]
37+
[PluginUserInterface("BasicPlugin.BeamPluginForm")]
38+
public class BeamPlugin : PluginBase
39+
{
40+
/// <summary>
41+
/// Gets the structures data.
42+
/// </summary>
43+
private StructuresData Data { get; }
44+
45+
/// <summary>
46+
/// The current length factor.
47+
/// </summary>
48+
private double lengthFactor;
49+
50+
/// <summary>
51+
/// The current profile.
52+
/// </summary>
53+
private string profile;
54+
55+
/// <summary>
56+
/// The default profile name.
57+
/// </summary>
58+
public static readonly string DefaultProfileName = "HEA300";
59+
60+
/// <summary>
61+
/// The name of the plugin. This value is used in the attribute above as well as with the Direct Manipulation creation and manipulation features.
62+
/// </summary>
63+
public const string PluginName = "Beam Plugin Example";
64+
65+
/// <summary>
66+
/// Initializes a new instance of the <see cref="BeamPlugin"/> class.
67+
/// </summary>
68+
/// <param name="data">The <see cref="StructuresData"/> object for the plugin.</param>
69+
public BeamPlugin(StructuresData data)
70+
{
71+
this.Data = data;
72+
}
73+
74+
/// <inheritdoc />
75+
public override bool Run(List<InputDefinition> input)
76+
{
77+
try
78+
{
79+
this.GetValuesFromDialog();
80+
81+
var points = (ArrayList)input[0].GetInput();
82+
var point1 = points[0] as Point;
83+
var point2 = points[1] as Point;
84+
var lengthVector = new Vector(point2 - point1);
85+
86+
if (this.lengthFactor > 0)
87+
{
88+
point2 = this.lengthFactor * lengthVector + point1;
89+
}
90+
91+
this.CreateBeam(point1, point2);
92+
}
93+
catch (Exception ex)
94+
{
95+
Console.WriteLine(@"Exception: " + ex);
96+
}
97+
98+
return true;
99+
}
100+
101+
/// <inheritdoc />
102+
public override List<InputDefinition> DefineInput()
103+
{
104+
var beamPicker = new Picker();
105+
var pointList = new List<InputDefinition>();
106+
107+
var point1 = beamPicker.PickPoint();
108+
var point2 = beamPicker.PickPoint();
109+
110+
var input1 = new InputDefinition(point1);
111+
var input2 = new InputDefinition(point2);
112+
113+
pointList.Add(input1);
114+
pointList.Add(input2);
115+
116+
return pointList;
117+
}
118+
119+
/// <summary>
120+
/// Gets the current values from dialog.
121+
/// </summary>
122+
private void GetValuesFromDialog()
123+
{
124+
this.lengthFactor = this.Data.LengthFactor;
125+
this.profile = this.Data.Profile;
126+
if (this.IsDefaultValue(this.lengthFactor))
127+
{
128+
this.lengthFactor = 2.0;
129+
}
130+
131+
if (this.IsDefaultValue(this.profile))
132+
{
133+
this.profile = DefaultProfileName;
134+
}
135+
}
136+
137+
/// <summary>
138+
/// Creates a beam using two input points.
139+
/// </summary>
140+
/// <param name="point1">The first input point.</param>
141+
/// <param name="point2">The second input point.</param>
142+
private void CreateBeam(Point point1, Point point2)
143+
{
144+
var myBeam = new TSM.Beam(point1, point2)
145+
{
146+
Profile = { ProfileString = this.profile },
147+
Finish = "PAINT"
148+
};
149+
150+
myBeam.Class = "2";
151+
myBeam.Material.MaterialString = "Steel_Undefined";
152+
myBeam.Name = "MyBeam";
153+
154+
myBeam.Insert();
155+
}
156+
}
157+
}

0 commit comments

Comments
 (0)