nsis dist

This commit is contained in:
lovebird 2026-03-14 19:03:09 +01:00
parent 0dcfbf919c
commit 80d355928d
647 changed files with 909426 additions and 40 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
ExportHTML
</name>
</assembly>
<members>
<member name="T:ExportHTML.My.Resources.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:ExportHTML.My.Resources.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:ExportHTML.My.Resources.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
</members>
</doc>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.1.0"
}
}
}

View File

@ -0,0 +1,5 @@
SET inputFilePath=%1
SET outFilePath=%2
SET view=%3
PowerShell -NoProfile -ExecutionPolicy Bypass -File "%~dp0export.ps1" %inputFilePath% %outFilePath% %view%

View File

@ -0,0 +1,108 @@
using SolidWorks.Interop.sldworks;
using System;
namespace CodeStack
{
public static class Exporter
{
#region Libraries
static Exporter()
{
AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
}
public static void LoadLibrary(params object[] libs)
{
foreach(string lib in libs)
{
Console.WriteLine(string.Format("Loading library: {0}", lib));
System.Reflection.Assembly assm = System.Reflection.Assembly.LoadFrom(lib);
Console.WriteLine(assm.GetName().ToString());
}
}
private static System.Reflection.Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)
{
foreach (System.Reflection.Assembly assm in AppDomain.CurrentDomain.GetAssemblies())
{
if(assm.GetName().ToString() == args.Name)
{
return assm;
}
};
return null;
}
#endregion
public static void ExportFile(string filePath, string outFilePath, string view)
{
Console.WriteLine("Connecting to SOLIDWORKS...");
ISldWorks app = Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application")) as ISldWorks;
if (app != null)
{
Console.WriteLine(string.Format("Opening file '{0}'...", filePath));
IDocumentSpecification docSpec = app.GetOpenDocSpec(filePath) as IDocumentSpecification;
docSpec.ReadOnly = true;
docSpec.Silent = true;
IModelDoc2 model = app.OpenDoc7(docSpec);
model.ShowNamedView2(view,-1);
model.ViewZoomtofit2();
int swViewDisplayHideAllTypes = 198;
model.SetUserPreferenceToggle(swViewDisplayHideAllTypes, true);
// DrawingDoc swDraw = model as DrawingDoc;
// View swView = swDraw.GetFirstView() as View;
// view.SetDisplayMode3(False, 4, false, false);
/*Member Description
swDisplayModeDEFAULT 8
swDisplayModeUNKNOWN -1
swFACETED_HIDDEN 6
swFACETED_HIDDEN_GREYED 5
swFACETED_WIREFRAME 4
swHIDDEN 2; Hidden Lines Removed (HLR)
swHIDDEN_GREYED 1; Hidden Lines Visible (HLV)
swSHADED 3
swSHADED_EDGES 7
swWIREFRAME 0
*/
if (model != null)
{
const int swSaveAsCurrentVersion = 0;
const int swSaveAsOptions_Silent = 1;
int err = -1;
int warn = -1;
Console.WriteLine(string.Format("Exporting file '{0}' to '{1}'...", filePath, outFilePath));
if (!model.Extension.SaveAs(outFilePath, swSaveAsCurrentVersion,
swSaveAsOptions_Silent, null, ref err, ref warn))
{
Console.WriteLine(string.Format("Failed to export '{0}' to '{1}'. Error code: {2}", filePath, outFilePath, err));
}
Console.WriteLine(string.Format("Closing file '{0}'...", filePath));
app.CloseDoc(model.GetTitle());
}
else
{
Console.WriteLine(string.Format("Failed to open document: '{0}'. Error code: {1}",filePath, docSpec.Error));
}
}
else
{
Console.WriteLine("Failed to connect to SOLIDWORKS instance");
}
}
}
}

View File

@ -0,0 +1,125 @@
$inputFilePath=$args[0]
$outFilePath=$args[1]
$view=$args[2]
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
$Assem = (
$ScriptDir + "\SolidWorks.Interop.sldworks.dll"
)
$Source = @"
using SolidWorks.Interop.sldworks;
using System;
namespace CodeStack
{
public static class Exporter
{
#region Libraries
static Exporter()
{
AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
}
public static void LoadLibrary(params object[] libs)
{
foreach(string lib in libs)
{
Console.WriteLine(string.Format("Loading library: {0}", lib));
System.Reflection.Assembly assm = System.Reflection.Assembly.LoadFrom(lib);
Console.WriteLine(assm.GetName().ToString());
}
}
private static System.Reflection.Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)
{
foreach (System.Reflection.Assembly assm in AppDomain.CurrentDomain.GetAssemblies())
{
if(assm.GetName().ToString() == args.Name)
{
return assm;
}
};
return null;
}
#endregion
public static void ExportFile(string filePath, string outFilePath, string view)
{
Console.WriteLine("Connecting to SOLIDWORKS...");
ISldWorks app = Activator.CreateInstance(Type.GetTypeFromProgID("SldWorks.Application")) as ISldWorks;
if (app != null)
{
Console.WriteLine(string.Format("Opening file '{0}'...", filePath));
IDocumentSpecification docSpec = app.GetOpenDocSpec(filePath) as IDocumentSpecification;
docSpec.ReadOnly = true;
docSpec.Silent = true;
IModelDoc2 model = app.OpenDoc7(docSpec);
model.ShowNamedView2(view,-1);
model.ViewZoomtofit2();
int swViewDisplayHideAllTypes = 198;
model.SetUserPreferenceToggle(swViewDisplayHideAllTypes, true);
// DrawingDoc swDraw = model as DrawingDoc;
// View swView = swDraw.GetFirstView() as View;
// view.SetDisplayMode3(False, 4, false, false);
/*Member Description
swDisplayModeDEFAULT 8
swDisplayModeUNKNOWN -1
swFACETED_HIDDEN 6
swFACETED_HIDDEN_GREYED 5
swFACETED_WIREFRAME 4
swHIDDEN 2; Hidden Lines Removed (HLR)
swHIDDEN_GREYED 1; Hidden Lines Visible (HLV)
swSHADED 3
swSHADED_EDGES 7
swWIREFRAME 0
*/
if (model != null)
{
const int swSaveAsCurrentVersion = 0;
const int swSaveAsOptions_Silent = 1;
int err = -1;
int warn = -1;
Console.WriteLine(string.Format("Exporting file '{0}' to '{1}'...", filePath, outFilePath));
if (!model.Extension.SaveAs(outFilePath, swSaveAsCurrentVersion,
swSaveAsOptions_Silent, null, ref err, ref warn))
{
Console.WriteLine(string.Format("Failed to export '{0}' to '{1}'. Error code: {2}", filePath, outFilePath, err));
}
Console.WriteLine(string.Format("Closing file '{0}'...", filePath));
app.CloseDoc(model.GetTitle());
}
else
{
Console.WriteLine(string.Format("Failed to open document: '{0}'. Error code: {1}",filePath, docSpec.Error));
}
}
else
{
Console.WriteLine("Failed to connect to SOLIDWORKS instance");
}
}
}
}
"@
Add-Type -TypeDefinition $Source -ReferencedAssemblies $Assem -Language CSharp
[CodeStack.Exporter]::LoadLibrary($Assem)
[CodeStack.Exporter]::ExportFile($inputFilePath, $outFilePath, $view)

View File

@ -0,0 +1,3 @@
SET inputFilePath=%1
SET outFilePath=%2
SET format=%2

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.1.0"
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.1.0"
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information"/>
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>

View File

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
ExportHTML
</name>
</assembly>
<members>
<member name="T:ExportHTML.My.Resources.Resources">
<summary>
A strongly-typed resource class, for looking up localized strings, etc.
</summary>
</member>
<member name="P:ExportHTML.My.Resources.Resources.ResourceManager">
<summary>
Returns the cached ResourceManager instance used by this class.
</summary>
</member>
<member name="P:ExportHTML.My.Resources.Resources.Culture">
<summary>
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
</summary>
</member>
</members>
</doc>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.1.0"
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp3.1",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.1.0"
}
}
}

View File

@ -0,0 +1,5 @@
SET inputFilePath=%1
SET outFilePath=%2
SET view=%3
PowerShell -NoProfile -ExecutionPolicy Bypass -File "%~dp0export.ps1" %inputFilePath% %outFilePath% %view%

Some files were not shown because too many files have changed in this diff Show More