Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
dariomangoni committed Jun 20, 2023
1 parent c05dff1 commit b9a16d6
Show file tree
Hide file tree
Showing 173 changed files with 477 additions and 90,231 deletions.
47 changes: 15 additions & 32 deletions ChronoSolidworksAddIn/ChronoSolidworksAddIn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>D:\Program Files\SolidWorks Corp\SolidWorks\</OutputPath>
<OutputPath>..\chrono-solidworks_install\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -45,7 +47,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>D:\Program Files\SolidWorks Corp\SolidWorks\</OutputPath>
<OutputPath>..\chrono-solidworks_install\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<RegisterForComInterop>false</RegisterForComInterop>
<DebugType>full</DebugType>
Expand All @@ -68,10 +70,8 @@
<HintPath>..\chrono-solidworks_install\hacd_CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="netstandard" />
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
Expand Down Expand Up @@ -99,36 +99,24 @@
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Drawing.Design" />
<Reference Include="System.Management" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=7.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.7.0.3\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Program Files\SOLIDWORKS Corp\SOLIDWORKS\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
Expand Down Expand Up @@ -186,11 +174,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="signature.snk" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions ChronoSolidworksAddIn/ConvertMates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
using ChronoEngineAddin;

// for Json Export
// for JSON export
using System.Text.Json;
using System.Text.Json.Nodes;
using static System.Windows.Forms.AxHost;
using System.Xml.Linq;


namespace ChronoEngine_SwAddin
Expand Down
1 change: 1 addition & 0 deletions ChronoSolidworksAddIn/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.8.0")]
[assembly: AssemblyFileVersion("2.0.8.0")]

39 changes: 19 additions & 20 deletions ChronoSolidworksAddIn/SidePanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ public void ExportToJson(ref JsonObject ChSystemNode)
_object_ID_used = 0;



//asciitext = "# PyChrono script generated from SolidWorks using Chrono::SolidWorks add-in \n" +
// "# Assembly: " + swModel.GetPathName() + "\n\n\n";

Expand Down Expand Up @@ -374,39 +373,39 @@ public void ExportToJson(ref JsonObject ChSystemNode)
};
ChSystemBodylistArray.Add(ChBodyGroundNode);

JsonTraverseComponent_for_ChBody(swRootComp, 1, ref ChSystemBodylistArray);
//JsonTraverseComponent_for_ChBody(swRootComp, 1, ref ChSystemBodylistArray);

ChSystemNode["bodies"] = ChSystemBodylistArray;

System.Windows.Forms.MessageBox.Show("Bodies _object_ID_used: " + _object_ID_used.ToString());


// Write down all constraints
//// Write down all constraints

MathTransform roottrasf = swRootComp.GetTotalTransform(true);
if (roottrasf == null)
{
IMathUtility swMath = (IMathUtility)this.mSWApplication.GetMathUtility();
double[] nulltr = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 };
roottrasf = (MathTransform)swMath.CreateTransform(nulltr);
}
//MathTransform roottrasf = swRootComp.GetTotalTransform(true);
//if (roottrasf == null)
//{
// IMathUtility swMath = (IMathUtility)this.mSWApplication.GetMathUtility();
// double[] nulltr = new double[] { 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 };
// roottrasf = (MathTransform)swMath.CreateTransform(nulltr);
//}

var ChSystemLinklistArray = new JsonArray();
//var ChSystemLinklistArray = new JsonArray();

Feature swFeat = (Feature)swModel.FirstFeature();
JsonTraverseFeatures_for_links(swFeat, 1, ref ChSystemLinklistArray, ref roottrasf, ref swRootComp);
ChSystemNode["links"] = ChSystemLinklistArray;
//Feature swFeat = (Feature)swModel.FirstFeature();
//JsonTraverseFeatures_for_links(swFeat, 1, ref ChSystemLinklistArray, ref roottrasf, ref swRootComp);
//ChSystemNode["links"] = ChSystemLinklistArray;

JsonTraverseComponent_for_links(swRootComp, 1, ref ChSystemLinklistArray, ref roottrasf);
//JsonTraverseComponent_for_links(swRootComp, 1, ref ChSystemLinklistArray, ref roottrasf);

System.Windows.Forms.MessageBox.Show("Links _object_ID_used: " + _object_ID_used.ToString());
//System.Windows.Forms.MessageBox.Show("Links _object_ID_used: " + _object_ID_used.ToString());



//// Write down all markers in assembly (that are not in sub parts, so they belong to 'ground' object)
////// Write down all markers in assembly (that are not in sub parts, so they belong to 'ground' object)

swFeat = (Feature)swModel.FirstFeature();
JsonTraverseFeatures_for_markers(swFeat, 1, ref ChBodyGroundNode, roottrasf);
//swFeat = (Feature)swModel.FirstFeature();
//JsonTraverseFeatures_for_markers(swFeat, 1, ref ChBodyGroundNode, roottrasf);

}

Expand Down Expand Up @@ -885,7 +884,7 @@ public void JsonTraverseComponent_for_visualizationshapes(Component2 swComp, lon
["1"] = new JsonObject // TODO: _object_ID
{
["_type"] = "ChModelFileShape",
["filename"] = "shapes_dir" + shapename + ".obj"
["filename"] = this.save_dir_shapes + shapename + ".obj"
},
["2"] = new JsonObject // TODO: _object_ID
{
Expand Down
40 changes: 40 additions & 0 deletions ChronoSolidworksAddIn/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,50 @@
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Validation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-17.6.0.0" newVersion="17.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.2" newVersion="7.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.2" newVersion="7.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Nerdbank.Streams" publicKeyToken="cac503e1823ce71c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.10.0.0" newVersion="2.10.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Composition.AttributedModel" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Composition.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Loading

0 comments on commit b9a16d6

Please sign in to comment.