├── .gitattributes
├── .gitee
├── ISSUE_TEMPLATE.zh-CN.md
└── PULL_REQUEST_TEMPLATE.zh-CN.md
├── .gitignore
├── 8888.png
├── CSharpAndSolidWorks.sln
├── CSharpAndSolidWorks
├── AddCenterPointForSketch.cs
├── AddSizeDimensionForDrawing.cs
├── App.config
├── BodyHelper.cs
├── CSharpAndSolidWorks.csproj
├── CSharpAndSolidWorks.csproj.DotSettings
├── ComStream.cs
├── ComparePart
│ ├── App.config
│ ├── Compare.cs
│ ├── ComparePart.csproj
│ ├── MainFrm.Designer.cs
│ ├── MainFrm.cs
│ ├── MainFrm.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── packages.config
├── ExportForm.Designer.cs
├── ExportForm.cs
├── ExportForm.resx
├── FormMain.Designer.cs
├── FormMain.cs
├── FormMain.resx
├── FrmCopy.Designer.cs
├── FrmCopy.cs
├── FrmCopy.resx
├── FrmScreen.Designer.cs
├── FrmScreen.cs
├── FrmScreen.resx
├── GetRayIntersectionWithBody
│ ├── FrmMain.Designer.cs
│ ├── FrmMain.cs
│ ├── FrmMain.resx
│ ├── GetRayIntersectionWithBody.csproj
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── SwManHandler2.cs
│ └── app.config
├── InsertDrawingNote
│ ├── App.config
│ ├── Comm.cs
│ ├── FrmNote.Designer.cs
│ ├── FrmNote.cs
│ ├── FrmNote.resx
│ ├── InsertDrawingNote.csproj
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── mouseClass.cs
│ └── packages.config
├── Mlogo.png
├── MyInterence.cs
├── MyPane.Designer.cs
├── MyPane.cs
├── MyPane.resx
├── PSWStandalone
│ ├── LICENSE
│ ├── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.vb
│ │ └── Settings.settings
│ ├── PFiles.vb
│ ├── PSWStandalone.vbproj
│ ├── PSolidworks.vb
│ ├── PStandAlone.vb
│ └── packages.config
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── Mlogo.png
│ └── bomlist.bmp
├── SolidWorks.ico
├── Solidworks API Help CN.xlsx
├── TemplateModel
│ ├── 01_CheckResult.sldprt
│ ├── 44_GetSketchText.SLDPRT
│ ├── 45_JoinTest.sldasm
│ ├── 54_ConvertEntitiesToSketch.SLDPRT
│ ├── 57_DeleteRelation.sldprt
│ ├── 68-AutoR.sldprt
│ ├── Assembly.asmdot
│ ├── CenterPoint.SLDPRT
│ ├── Drawing.drwdot
│ ├── DrawingTemplate.DRWDOT
│ ├── HoleAutoDimension1.SLDDRW
│ ├── HoleAutoDimension1.SLDPRT
│ ├── HolePlate-2.SLDDRW
│ ├── HolePlate-2.SLDPRT
│ ├── HolePlate.SLDDRW
│ ├── HolePlate.SLDPRT
│ ├── ImportDWG.dwg
│ ├── InsertHole.SLDPRT
│ ├── JoinPart2.SLDPRT
│ ├── MBDTest.SLDPRT
│ ├── MBDTest_Clear.SLDPRT
│ ├── MateTest.sldprt
│ ├── Measure.SLDDRW
│ ├── Measure.SLDPRT
│ ├── Measure_defeature.sldprt
│ ├── Part.prtdot
│ ├── PictureAndQRCode.SLDDRW
│ ├── ShuangLiangDuanLiang.SLDPRT
│ ├── Simulation API Demo.SLDPRT
│ ├── TempAssembly.SLDDRW
│ ├── TempAssembly.sldasm
│ ├── TestBlock.SLDBLK
│ ├── WeldmentTest.SLDPRT
│ ├── bodies.SLDPRT
│ ├── bodies.bmp
│ ├── bodies.sldasm
│ ├── bodies
│ │ ├── bodies-零件1.sldprt
│ │ ├── bodies-零件2.sldprt
│ │ ├── bodies-零件3.sldprt
│ │ ├── bodies-零件7.sldprt
│ │ ├── 复制-bodies-零件2-2.sldprt
│ │ ├── 复制-bodies-零件2-3.sldprt
│ │ └── 复制-bodies-零件2.sldprt
│ ├── clamp1.sldprt
│ ├── clamp2.sldprt
│ ├── clamp3.sldprt
│ ├── drwdot
│ │ ├── gb_a3.drwdot
│ │ └── gb_a4.drwdot
│ ├── globalvariable.SLDPRT
│ ├── localBodies-1.sldprt
│ ├── oc0zwe3w.bmp
│ ├── replaceDrawingRef
│ │ ├── AA(BB) - 副本.SLDPRT
│ │ ├── AA(BB) - 副本.slddrw
│ │ ├── AA(BB).SLDPRT
│ │ └── AA(BB).slddrw
│ ├── repleaceReference
│ │ ├── part1.SLDDRW
│ │ ├── part1.SLDPRT
│ │ └── part1new.SLDPRT
│ ├── sendToCustomerBodies-1.sldprt
│ ├── sheetformat
│ │ └── a4 - gb.slddrt
│ └── smallball.dat
├── ThumbnailHelper.cs
├── Utility.cs
├── Weldment Profiles
│ └── AAAA
│ │ └── BBBB
│ │ ├── 020x020.SLDLFP
│ │ └── 030x030.SLDLFP
├── eDrawingDLL
│ ├── Form1.Designer.vb
│ ├── Form1.resx
│ ├── Form1.vb
│ ├── My Project
│ │ ├── Application.Designer.vb
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.vb
│ │ ├── Settings.settings
│ │ └── app.manifest
│ ├── MyeDrawing.vbproj
│ ├── app.config
│ ├── edDWHost.Designer.vb
│ ├── edDWHost.vb
│ └── refDll
│ │ ├── EModelView.dll
│ │ ├── eDrawingHostControl.dll
│ │ └── edrawing help.zip
├── packages.config
└── screenClass
│ ├── GetWindowsSize.cs
│ ├── MonitorInfo.cs
│ └── MyScreen.cs
├── LICENSE
├── PaineTool
├── AddinIcon.bmp
├── AssemblyInfo.cs
├── EventHandling.cs
├── FeatureIcon.bmp
├── MyPMPControl.Designer.cs
├── MyPMPControl.cs
├── MyPMPControl.resx
├── NewFeature
│ ├── EnumItem.cs
│ ├── FaceEdgeInfos.cs
│ ├── Geometry.cs
│ ├── NewFeatureHandler.cs
│ └── NewFeaturePMPage.cs
├── PMPHandler.cs
├── PaineTool.csproj
├── SwAddin.cs
├── UserPMPage.cs
├── mainicon_128.png
├── mainicon_20.png
├── mainicon_32.png
├── mainicon_40.png
├── mainicon_64.png
├── mainicon_96.png
├── packages.config
├── toolbar128x.png
├── toolbar20x.png
├── toolbar32x.png
├── toolbar40x.png
├── toolbar64x.png
└── toolbar96x.png
├── README.en.md
├── README.md
├── Solidworks API Help CN.xlsx
├── TMYTest.SLDPRT
├── dll
├── ConnectToSolidworks.dll
├── SolidWorks.Interop.SWRoutingLib.dll
├── SolidWorks.Interop.cosworks.dll
├── SolidWorks.Interop.sldworks.dll
├── SolidWorks.Interop.sw3dprinter.dll
├── SolidWorks.Interop.swcommands.dll
├── SolidWorks.Interop.swconst.dll
├── SolidWorks.Interop.swdimxpert.dll
├── SolidWorks.Interop.swdocumentmgr.dll
├── SolidWorks.Interop.swmotionstudy.dll
├── SolidWorks.Interop.swpublished.dll
└── SolidWorksTools.dll
├── v.png
└── 如何测试.mp4
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitee/ISSUE_TEMPLATE.zh-CN.md:
--------------------------------------------------------------------------------
1 | ### 该问题是怎么引起的?
2 |
3 |
4 |
5 | ### 重现步骤
6 |
7 |
8 |
9 | ### 报错信息
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md:
--------------------------------------------------------------------------------
1 | ### 相关的Issue
2 |
3 |
4 | ### 原因(目的、解决的问题等)
5 |
6 |
7 | ### 描述(做了什么,变更了什么)
8 |
9 |
10 | ### 测试用例
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/8888.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/8888.png
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/CSharpAndSolidWorks.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | CSharp70
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Runtime.InteropServices.ComTypes;
4 |
5 | namespace CSharpAndSolidWorks
6 | {
7 | public class ComStream : Stream
8 | {
9 | //The managed stream being wrapped
10 | private IStream originalStream_;
11 |
12 | public ComStream(IStream stream)
13 | {
14 | if (stream != null)
15 | {
16 | originalStream_ = stream;
17 | }
18 | else
19 | {
20 | throw new ArgumentNullException("stream");
21 | }
22 | }
23 |
24 | ~ComStream()
25 | {
26 | Close();
27 | }
28 |
29 | // property to get original stream object
30 | public IStream UnderlyingStream
31 | {
32 | get
33 | {
34 | return originalStream_;
35 | }
36 | }
37 |
38 | // reads a specified number of bytes from the stream object
39 | // into memory starting at the current seek pointer
40 | public override unsafe int Read(byte[] buffer, int offset, int count)
41 | {
42 | if (originalStream_ == null)
43 | {
44 | throw new ObjectDisposedException("originalStream_");
45 | }
46 |
47 | if (offset != 0)
48 | {
49 | throw new NotSupportedException("only 0 offset is supported");
50 | }
51 |
52 | int bytesRead;
53 |
54 | IntPtr address = new IntPtr(&bytesRead);
55 |
56 | originalStream_.Read(buffer, count, address);
57 |
58 | return bytesRead;
59 | }
60 |
61 | // writes a specified number of bytes into the stream object
62 | // starting at the current seek pointer
63 | public override void Write(byte[] buffer, int offset, int count)
64 | {
65 | if (originalStream_ == null)
66 | {
67 | throw new ObjectDisposedException("originalStream_");
68 | }
69 |
70 | if (offset != 0)
71 | {
72 | throw new NotSupportedException("only 0 offset is supported");
73 | }
74 |
75 | originalStream_.Write(buffer, count, IntPtr.Zero);
76 | }
77 |
78 | // changes the seek pointer to a new location relative to the beginning
79 | // of the stream, the end of the stream, or the current seek position
80 |
81 | public override unsafe long Seek(long offset, SeekOrigin origin)
82 | {
83 | if (originalStream_ == null)
84 | {
85 | throw new ObjectDisposedException("originalStream_");
86 | }
87 |
88 | long position = 0;
89 |
90 | IntPtr address = new IntPtr(&position);
91 |
92 | originalStream_.Seek(offset, (int)origin, address);
93 |
94 | return position;
95 | }
96 |
97 | public override long Length
98 | {
99 | get
100 | {
101 | if (originalStream_ == null)
102 | {
103 | throw new ObjectDisposedException("originalStream_");
104 | }
105 |
106 | STATSTG statstg;
107 |
108 | originalStream_.Stat(out statstg, 1 /* STATSFLAG_NONAME*/ );
109 |
110 | return statstg.cbSize;
111 | }
112 | }
113 |
114 | public override long Position
115 | {
116 | get
117 | {
118 | return Seek(0, SeekOrigin.Current);
119 | }
120 | set
121 | {
122 | Seek(value, SeekOrigin.Begin);
123 | }
124 | }
125 |
126 | // changes the size of the stream object
127 | public override void SetLength(long value)
128 | {
129 | if (originalStream_ == null)
130 | {
131 | throw new ObjectDisposedException("originalStream_");
132 | }
133 |
134 | originalStream_.SetSize(value);
135 | }
136 |
137 | // closes (disposes) the stream
138 | public override void Close()
139 | {
140 | if (originalStream_ != null)
141 | {
142 | originalStream_.Commit(0);
143 |
144 | // Marshal.ReleaseComObject( originalStream_ );
145 | originalStream_ = null;
146 |
147 | GC.SuppressFinalize(this);
148 | }
149 | }
150 |
151 | public override void Flush()
152 | {
153 | originalStream_.Commit(0);
154 | }
155 |
156 | public override bool CanRead
157 | {
158 | get
159 | {
160 | return true;
161 | }
162 | }
163 |
164 | public override bool CanWrite
165 | {
166 | get
167 | {
168 | return true;
169 | }
170 | }
171 |
172 | public override bool CanSeek
173 | {
174 | get
175 | {
176 | return true;
177 | }
178 | }
179 | }
180 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/ComparePart.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {568D1A37-B758-4169-A24D-CCE1FCC2252D}
8 | WinExe
9 | ComparePart
10 | ComparePart
11 | v4.8
12 | 512
13 | true
14 | true
15 |
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 | false
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 | false
37 |
38 |
39 |
40 |
41 |
42 |
43 | ..\..\dll\SolidWorks.Interop.sldworks.dll
44 | True
45 |
46 |
47 | ..\..\dll\SolidWorks.Interop.swcommands.dll
48 | True
49 |
50 |
51 | ..\..\dll\SolidWorks.Interop.swconst.dll
52 | True
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | Form
70 |
71 |
72 | MainFrm.cs
73 |
74 |
75 |
76 |
77 | MainFrm.cs
78 |
79 |
80 | ResXFileCodeGenerator
81 | Resources.Designer.cs
82 | Designer
83 |
84 |
85 | True
86 | Resources.resx
87 | True
88 |
89 |
90 |
91 | SettingsSingleFileGenerator
92 | Settings.Designer.cs
93 |
94 |
95 | True
96 | Settings.settings
97 | True
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/MainFrm.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 | using System;
3 | using System.Runtime.InteropServices;
4 | using System.Windows.Forms;
5 |
6 | namespace ComparePart
7 | {
8 | public partial class MainFrm : Form
9 | {
10 | public MainFrm()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private void butCompare_Click(object sender, EventArgs e)
16 | {
17 | Compare compare = new Compare(ConnectToSolidWorks());
18 |
19 | if (compare.CheckTwoParts(txtSendtoCustomer.Text, txtLocal.Text) == true)
20 | {
21 | MessageBox.Show("这两个零件有区别");
22 | }
23 | else
24 | {
25 | MessageBox.Show("这两个零件一样");
26 | }
27 | }
28 |
29 | private SldWorks ConnectToSolidWorks()
30 | {
31 | SldWorks works2;
32 | try
33 | {
34 | works2 = (SldWorks)Marshal.GetActiveObject("SldWorks.Application.23");
35 | }
36 | catch (COMException)
37 | {
38 | try
39 | {
40 | works2 = (SldWorks)Marshal.GetActiveObject("SldWorks.Application.26");
41 | }
42 | catch (COMException)
43 | {
44 | // MessageBox.Show("Could not connect to SolidWorks.", "SolidWorks", MessageBoxButtons.OK, MessageBoxIcon.Hand);
45 | works2 = null;
46 | }
47 | }
48 | return works2;
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/MainFrm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace ComparePart
5 | {
6 | internal static class Program
7 | {
8 | ///
9 | /// 应用程序的主入口点。
10 | ///
11 | [STAThread]
12 | private static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new MainFrm());
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的一般信息由以下
5 | // 控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("ComparePart")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Microsoft")]
11 | [assembly: AssemblyProduct("ComparePart")]
12 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 会使此程序集中的类型
17 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18 | //请将此类型的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("568d1a37-b758-4169-a24d-cce1fcc2252d")]
23 |
24 | // 程序集的版本信息由下列四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
32 | // 方法是按如下所示使用“*”: :
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ComparePart.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ComparePart.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ComparePart.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ComparePart/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/ExportForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/FrmCopy.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CSharpAndSolidWorks
2 | {
3 | partial class FrmCopy
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmCopy));
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.txtFrom = new System.Windows.Forms.TextBox();
34 | this.label2 = new System.Windows.Forms.Label();
35 | this.txtTo = new System.Windows.Forms.TextBox();
36 | this.btnPack = new System.Windows.Forms.Button();
37 | this.progressBarCopy = new System.Windows.Forms.ProgressBar();
38 | this.SuspendLayout();
39 | //
40 | // label1
41 | //
42 | this.label1.AutoSize = true;
43 | this.label1.Location = new System.Drawing.Point(14, 26);
44 | this.label1.Name = "label1";
45 | this.label1.Size = new System.Drawing.Size(46, 13);
46 | this.label1.TabIndex = 0;
47 | this.label1.Text = "源文件:";
48 | //
49 | // txtFrom
50 | //
51 | this.txtFrom.Location = new System.Drawing.Point(74, 23);
52 | this.txtFrom.Name = "txtFrom";
53 | this.txtFrom.Size = new System.Drawing.Size(532, 20);
54 | this.txtFrom.TabIndex = 1;
55 | //
56 | // label2
57 | //
58 | this.label2.AutoSize = true;
59 | this.label2.Location = new System.Drawing.Point(14, 61);
60 | this.label2.Name = "label2";
61 | this.label2.Size = new System.Drawing.Size(46, 13);
62 | this.label2.TabIndex = 0;
63 | this.label2.Text = "复制到:";
64 | //
65 | // txtTo
66 | //
67 | this.txtTo.Location = new System.Drawing.Point(74, 58);
68 | this.txtTo.Name = "txtTo";
69 | this.txtTo.Size = new System.Drawing.Size(532, 20);
70 | this.txtTo.TabIndex = 1;
71 | //
72 | // btnPack
73 | //
74 | this.btnPack.Location = new System.Drawing.Point(489, 91);
75 | this.btnPack.Name = "btnPack";
76 | this.btnPack.Size = new System.Drawing.Size(117, 28);
77 | this.btnPack.TabIndex = 0;
78 | this.btnPack.Text = "打包";
79 | this.btnPack.UseVisualStyleBackColor = true;
80 | this.btnPack.Click += new System.EventHandler(this.btnPack_Click);
81 | //
82 | // progressBarCopy
83 | //
84 | this.progressBarCopy.Dock = System.Windows.Forms.DockStyle.Bottom;
85 | this.progressBarCopy.Location = new System.Drawing.Point(0, 126);
86 | this.progressBarCopy.Name = "progressBarCopy";
87 | this.progressBarCopy.Size = new System.Drawing.Size(627, 23);
88 | this.progressBarCopy.TabIndex = 2;
89 | //
90 | // FrmCopy
91 | //
92 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
93 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
94 | this.ClientSize = new System.Drawing.Size(627, 149);
95 | this.Controls.Add(this.progressBarCopy);
96 | this.Controls.Add(this.btnPack);
97 | this.Controls.Add(this.txtTo);
98 | this.Controls.Add(this.label2);
99 | this.Controls.Add(this.txtFrom);
100 | this.Controls.Add(this.label1);
101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
102 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
103 | this.MaximizeBox = false;
104 | this.MinimizeBox = false;
105 | this.Name = "FrmCopy";
106 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
107 | this.Text = "文件打包";
108 | this.ResumeLayout(false);
109 | this.PerformLayout();
110 |
111 | }
112 |
113 | #endregion
114 |
115 | private System.Windows.Forms.Label label1;
116 | private System.Windows.Forms.TextBox txtFrom;
117 | private System.Windows.Forms.Label label2;
118 | private System.Windows.Forms.TextBox txtTo;
119 | private System.Windows.Forms.Button btnPack;
120 | private System.Windows.Forms.ProgressBar progressBarCopy;
121 | }
122 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/FrmMain.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/GetRayIntersectionWithBody.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {0E54076A-0241-409A-B787-33D7738D75B1}
8 | WinExe
9 | GetRayIntersectionWithBody
10 | GetRayIntersectionWithBody
11 | v4.5.2
12 | 512
13 | true
14 |
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | false
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 | false
36 |
37 |
38 |
39 | False
40 | ..\..\dll\ConnectToSolidworks.dll
41 |
42 |
43 | False
44 | False
45 | ..\..\dll\SolidWorks.Interop.sldworks.dll
46 |
47 |
48 | False
49 | False
50 | ..\..\dll\SolidWorks.Interop.swconst.dll
51 |
52 |
53 | False
54 | False
55 | ..\..\dll\SolidWorks.Interop.swpublished.dll
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | Form
71 |
72 |
73 | FrmMain.cs
74 |
75 |
76 |
77 |
78 |
79 | FrmMain.cs
80 |
81 |
82 | ResXFileCodeGenerator
83 | Resources.Designer.cs
84 | Designer
85 |
86 |
87 | True
88 | Resources.resx
89 | True
90 |
91 |
92 |
93 | SettingsSingleFileGenerator
94 | Settings.Designer.cs
95 |
96 |
97 | True
98 | Settings.settings
99 | True
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace GetRayIntersectionWithBody
5 | {
6 | internal static class Program
7 | {
8 | ///
9 | /// 应用程序的主入口点。
10 | ///
11 | [STAThread]
12 | private static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new FrmMain());
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的一般信息由以下
5 | // 控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("GetRayIntersectionWithBody")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Hewlett-Packard")]
11 | [assembly: AssemblyProduct("GetRayIntersectionWithBody")]
12 | [assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2020")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 会使此程序集中的类型
17 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18 | //请将此类型的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("0e54076a-0241-409a-b787-33d7738d75b1")]
23 |
24 | // 程序集的版本信息由下列四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
32 | // 方法是按如下所示使用“*”: :
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GetRayIntersectionWithBody.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GetRayIntersectionWithBody.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace GetRayIntersectionWithBody.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/GetRayIntersectionWithBody/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Comm.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace CSharpAndSolidWorks
5 | {
6 | public class Comm
7 | {
8 | public static SldWorks ConnectToSolidWorks()
9 | {
10 | SldWorks works2;
11 | try
12 | {
13 | works2 = (SldWorks)Marshal.GetActiveObject("SldWorks.Application.23");
14 | }
15 | catch (COMException)
16 | {
17 | try
18 | {
19 | works2 = (SldWorks)Marshal.GetActiveObject("SldWorks.Application.26");
20 | }
21 | catch (COMException)
22 | {
23 | // MessageBox.Show("Could not connect to SolidWorks.", "SolidWorks", MessageBoxButtons.OK, MessageBoxIcon.Hand);
24 | works2 = null;
25 | }
26 | }
27 | return works2;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/FrmNote.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/InsertDrawingNote.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {1645944C-40E0-4A01-ACA3-D62A35E01A97}
8 | WinExe
9 | InsertDrawingNote
10 | InsertDrawingNote
11 | v4.5.2
12 | 512
13 | true
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 | ..\..\dll\SolidWorks.Interop.sldworks.dll
41 | False
42 |
43 |
44 | ..\..\dll\SolidWorks.Interop.swcommands.dll
45 | False
46 |
47 |
48 | ..\..\dll\SolidWorks.Interop.swconst.dll
49 | False
50 |
51 |
52 | ..\..\dll\SolidWorksTools.dll
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | Form
70 |
71 |
72 | FrmNote.cs
73 |
74 |
75 |
76 |
77 |
78 | FrmNote.cs
79 |
80 |
81 | ResXFileCodeGenerator
82 | Resources.Designer.cs
83 | Designer
84 |
85 |
86 | True
87 | Resources.resx
88 |
89 |
90 |
91 | SettingsSingleFileGenerator
92 | Settings.Designer.cs
93 |
94 |
95 | True
96 | Settings.settings
97 | True
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace CSharpAndSolidWorks
5 | {
6 | internal static class Program
7 | {
8 | ///
9 | /// 应用程序的主入口点。
10 | ///
11 | [STAThread]
12 | private static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new FrmNote());
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的一般信息由以下
5 | // 控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("InsertDrawingNote")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Microsoft")]
11 | [assembly: AssemblyProduct("InsertDrawingNote")]
12 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 会使此程序集中的类型
17 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18 | //请将此类型的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("1645944c-40e0-4a01-aca3-d62a35e01a97")]
23 |
24 | // 程序集的版本信息由下列四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
32 | // 方法是按如下所示使用“*”: :
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能导致不正确的行为,如果
7 | // 重新生成代码,则所做更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace InsertDrawingNote.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 强类型资源类,用于查找本地化字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的缓存 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InsertDrawingNote.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 覆盖当前线程的 CurrentUICulture 属性
56 | /// 使用此强类型的资源类的资源查找。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace InsertDrawingNote.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/mouseClass.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 | using SolidWorks.Interop.swconst;
3 | using System;
4 | using System.Diagnostics;
5 | using System.Windows.Forms;
6 |
7 | namespace CSharpAndSolidWorks
8 | {
9 | public class mouseClass
10 | {
11 | private FrmNote _frmNote;
12 |
13 | public mouseClass(FrmNote frmNote)
14 | {
15 | _frmNote = frmNote;
16 | }
17 |
18 | public int ms_MouseSelectNotify(int ix, int iy, double X, double Y, double Z)
19 | {
20 | try
21 | {
22 | Debug.Print("Mouse loc ix = " + ix + " iy = " + iy + " x= " + X);
23 |
24 | SldWorks swApp;
25 | swApp = Comm.ConnectToSolidWorks();
26 |
27 | bool boolstatus;
28 | long longstatus;
29 |
30 | ModelDoc2 swModel;
31 | swModel = (ModelDoc2)swApp.ActiveDoc;
32 |
33 | Note myNote;
34 | Annotation myAnnotation;
35 |
36 | myNote = (Note)swModel.InsertNote(_frmNote.activeNote);
37 | if (myNote != null)
38 | {
39 | myNote.Angle = 0;
40 | boolstatus = myNote.SetBalloon(0, 0);
41 | myAnnotation = (Annotation)myNote.GetAnnotation();
42 | if (myAnnotation != null)
43 | {
44 | longstatus = myAnnotation.SetLeader3((int)swLeaderStyle_e.swSTRAIGHT, 0, true, false, false, false);
45 |
46 | boolstatus = myAnnotation.SetPosition(X + FrmNote.x / 1000, Y + FrmNote.y / 1000, Z);
47 |
48 | TextFormat txtFormat = default(TextFormat);
49 |
50 | txtFormat = (TextFormat)myAnnotation.GetTextFormat(0);
51 |
52 | txtFormat.Bold = true;
53 | txtFormat.CharHeight = 0.01;
54 |
55 | boolstatus = myAnnotation.SetTextFormat(0, false, txtFormat);
56 | }
57 | }
58 |
59 | swModel.ClearSelection2(true);
60 | swModel.WindowRedraw();
61 |
62 | _frmNote.NextNote();
63 |
64 | if (FrmNote.haveNextNote == false)
65 | {
66 | FrmNote.TheMouse.MouseSelectNotify -= ms_MouseSelectNotify;
67 | }
68 | else
69 | {
70 | Frame swFrame = (Frame)swApp.Frame();
71 |
72 | swFrame.SetStatusBarText("Next Click to insert " + _frmNote.activeNote);
73 | }
74 |
75 | return 1;
76 | }
77 | catch (Exception)
78 | {
79 | MessageBox.Show("Error!");
80 |
81 | return 0;
82 | }
83 | }
84 | }
85 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/InsertDrawingNote/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Mlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/Mlogo.png
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/MyInterence.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 | using System.Collections.Generic;
3 |
4 | namespace CSharpAndSolidWorks
5 | {
6 | public class MyInterence
7 | {
8 | public Component2 Component2 { get; set; }
9 |
10 | public List Face2s { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Paine-Zeng
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | false
5 | 0
6 | true
7 | 0
8 | 1
9 | true
10 |
11 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System.Reflection
2 | Imports System.Runtime.InteropServices
3 |
4 | ' General Information about an assembly is controlled through the following
5 | ' set of attributes. Change these attribute values to modify the information
6 | ' associated with an assembly.
7 |
8 | ' Review the values of the assembly attributes
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
20 |
21 |
22 | ' Version information for an assembly consists of the following four values:
23 | '
24 | ' Major Version
25 | ' Minor Version
26 | ' Build Number
27 | ' Revision
28 | '
29 | ' You can specify all the values or you can default the Build and Revision Numbers
30 | ' by using the '*' as shown below:
31 | '
32 |
33 |
34 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("PSWStandalon.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.PSWStandalon.My.MySettings
68 | Get
69 | Return Global.PSWStandalon.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/PSWStandalone.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {20A47175-69C7-445E-B4D7-DC16A95B7684}
8 | Library
9 | PSWStandalon
10 | PSWStandalon
11 | 512
12 | Windows
13 | v4.5.2
14 | true
15 |
16 |
17 |
18 | true
19 | full
20 | true
21 | true
22 | bin\Debug\
23 | PSWStandalon.xml
24 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
25 | false
26 |
27 |
28 | pdbonly
29 | false
30 | true
31 | true
32 | bin\Release\
33 | PSWStandalon.xml
34 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
35 | false
36 |
37 |
38 | On
39 |
40 |
41 | Binary
42 |
43 |
44 | Off
45 |
46 |
47 | On
48 |
49 |
50 |
51 | ..\..\dll\SolidWorks.Interop.sldworks.dll
52 | False
53 | False
54 |
55 |
56 | ..\..\dll\SolidWorks.Interop.swconst.dll
57 | False
58 | False
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | True
83 | Application.myapp
84 | True
85 |
86 |
87 | True
88 | True
89 | Resources.resx
90 |
91 |
92 | True
93 | Settings.settings
94 | True
95 |
96 |
97 |
98 |
99 |
100 |
101 | VbMyResourcesResXFileCodeGenerator
102 | Resources.Designer.vb
103 | My.Resources
104 | Designer
105 |
106 |
107 |
108 |
109 | MyApplicationCodeGenerator
110 | Application.Designer.vb
111 |
112 |
113 | SettingsSingleFileGenerator
114 | My
115 | Settings.Designer.vb
116 |
117 |
118 |
119 |
120 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/PSWStandalone/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace CSharpAndSolidWorks
5 | {
6 | internal static class Program
7 | {
8 | ///
9 | /// 应用程序的主入口点。
10 | ///
11 | [STAThread]
12 | private static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new Btn_Filter());
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的一般信息由以下
5 | // 控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("CSharpAndSolidWorks")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Microsoft")]
11 | [assembly: AssemblyProduct("CSharpAndSolidWorks")]
12 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 会使此程序集中的类型
17 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18 | //请将此类型的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(true)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("646b6723-c58e-40b1-bca9-3817f73e5f88")]
23 |
24 | // 程序集的版本信息由下列四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
32 | // 方法是按如下所示使用“*”: :
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CSharpAndSolidWorks.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CSharpAndSolidWorks.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
65 | ///
66 | internal static System.Drawing.Bitmap bomlist {
67 | get {
68 | object obj = ResourceManager.GetObject("bomlist", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CSharpAndSolidWorks.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Resources/Mlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/Resources/Mlogo.png
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Resources/bomlist.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/Resources/bomlist.bmp
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/SolidWorks.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/SolidWorks.ico
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Solidworks API Help CN.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/Solidworks API Help CN.xlsx
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/01_CheckResult.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/01_CheckResult.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/44_GetSketchText.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/44_GetSketchText.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/45_JoinTest.sldasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/45_JoinTest.sldasm
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/54_ConvertEntitiesToSketch.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/54_ConvertEntitiesToSketch.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/57_DeleteRelation.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/57_DeleteRelation.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/68-AutoR.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/68-AutoR.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Assembly.asmdot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Assembly.asmdot
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/CenterPoint.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/CenterPoint.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Drawing.drwdot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Drawing.drwdot
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/DrawingTemplate.DRWDOT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/DrawingTemplate.DRWDOT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/HoleAutoDimension1.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/HoleAutoDimension1.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/HoleAutoDimension1.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/HoleAutoDimension1.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/HolePlate-2.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/HolePlate-2.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/HolePlate-2.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/HolePlate-2.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/HolePlate.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/HolePlate.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/HolePlate.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/HolePlate.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/ImportDWG.dwg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/ImportDWG.dwg
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/InsertHole.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/InsertHole.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/JoinPart2.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/JoinPart2.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/MBDTest.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/MBDTest.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/MBDTest_Clear.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/MBDTest_Clear.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/MateTest.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/MateTest.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Measure.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Measure.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Measure.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Measure.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Measure_defeature.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Measure_defeature.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Part.prtdot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Part.prtdot
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/PictureAndQRCode.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/PictureAndQRCode.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/ShuangLiangDuanLiang.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/ShuangLiangDuanLiang.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/Simulation API Demo.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/Simulation API Demo.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/TempAssembly.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/TempAssembly.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/TempAssembly.sldasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/TempAssembly.sldasm
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/TestBlock.SLDBLK:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/TestBlock.SLDBLK
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/WeldmentTest.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/WeldmentTest.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies.bmp
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies.sldasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies.sldasm
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件1.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件1.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件2.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件2.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件3.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件3.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件7.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/bodies-零件7.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/复制-bodies-零件2-2.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/复制-bodies-零件2-2.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/复制-bodies-零件2-3.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/复制-bodies-零件2-3.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/bodies/复制-bodies-零件2.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/bodies/复制-bodies-零件2.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/clamp1.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/clamp1.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/clamp2.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/clamp2.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/clamp3.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/clamp3.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/drwdot/gb_a3.drwdot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/drwdot/gb_a3.drwdot
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/drwdot/gb_a4.drwdot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/drwdot/gb_a4.drwdot
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/globalvariable.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/globalvariable.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/localBodies-1.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/localBodies-1.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/oc0zwe3w.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/oc0zwe3w.bmp
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB) - 副本.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB) - 副本.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB) - 副本.slddrw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB) - 副本.slddrw
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB).SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB).SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB).slddrw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/replaceDrawingRef/AA(BB).slddrw
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/repleaceReference/part1.SLDDRW:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/repleaceReference/part1.SLDDRW
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/repleaceReference/part1.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/repleaceReference/part1.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/repleaceReference/part1new.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/repleaceReference/part1new.SLDPRT
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/sendToCustomerBodies-1.sldprt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/sendToCustomerBodies-1.sldprt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/sheetformat/a4 - gb.slddrt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/sheetformat/a4 - gb.slddrt
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/TemplateModel/smallball.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/TemplateModel/smallball.dat
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Weldment Profiles/AAAA/BBBB/020x020.SLDLFP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/Weldment Profiles/AAAA/BBBB/020x020.SLDLFP
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/Weldment Profiles/AAAA/BBBB/030x030.SLDLFP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/Weldment Profiles/AAAA/BBBB/030x030.SLDLFP
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/Form1.Designer.vb:
--------------------------------------------------------------------------------
1 |
2 | Partial Class Form1
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 |
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 |
24 | Private Sub InitializeComponent()
25 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
26 | Me.Button1 = New System.Windows.Forms.Button()
27 | Me.Panel1 = New System.Windows.Forms.Panel()
28 | Me.SuspendLayout
29 | '
30 | 'Button1
31 | '
32 | Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right),System.Windows.Forms.AnchorStyles)
33 | Me.Button1.Location = New System.Drawing.Point(993, 12)
34 | Me.Button1.Name = "Button1"
35 | Me.Button1.Size = New System.Drawing.Size(64, 38)
36 | Me.Button1.TabIndex = 0
37 | Me.Button1.Text = "Open File"
38 | Me.Button1.UseVisualStyleBackColor = true
39 | '
40 | 'Panel1
41 | '
42 | Me.Panel1.BackColor = System.Drawing.SystemColors.ControlDark
43 | Me.Panel1.Location = New System.Drawing.Point(0, 1)
44 | Me.Panel1.Name = "Panel1"
45 | Me.Panel1.Size = New System.Drawing.Size(977, 605)
46 | Me.Panel1.TabIndex = 1
47 | '
48 | 'Form1
49 | '
50 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!)
51 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
52 | Me.ClientSize = New System.Drawing.Size(1069, 618)
53 | Me.Controls.Add(Me.Panel1)
54 | Me.Controls.Add(Me.Button1)
55 | Me.Icon = CType(resources.GetObject("$this.Icon"),System.Drawing.Icon)
56 | Me.Name = "Form1"
57 | Me.Text = "eDrawing"
58 | Me.ResumeLayout(false)
59 |
60 | End Sub
61 | Friend WithEvents Button1 As System.Windows.Forms.Button
62 | Friend WithEvents Panel1 As System.Windows.Forms.Panel
63 | End Class
64 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/Form1.vb:
--------------------------------------------------------------------------------
1 | Imports EModelView
2 |
3 | Public Class Form1
4 | Public hostContainer As edDWHost = Nothing
5 | Public WithEvents emvControl As EModelViewControl = Nothing
6 |
7 | Public filepath As String = ""
8 |
9 | Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
10 | emvControl.CloseActiveDoc("")
11 |
12 | emvControl = Nothing
13 |
14 | hostContainer = Nothing
15 |
16 | End Sub
17 |
18 | Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
19 |
20 | hostContainer = New edDWHost
21 |
22 | ' Add the container to this form before trying to get the underlying OCX
23 | Panel1.Controls.Add(hostContainer)
24 | hostContainer.Dock = DockStyle.Fill
25 |
26 | emvControl = hostContainer.GetOcx()
27 |
28 | If filepath <> "" Then
29 | emvControl.OpenDoc(filepath, False, False, True, "")
30 | End If
31 |
32 | End Sub
33 |
34 | Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
35 |
36 | filepath = "D:\09_Study\CSharpAndSolidWorks\CSharpAndSolidWorks\TemplateModel\bodies.sldasm"
37 |
38 | emvControl.OpenDoc(filepath, False, False, True, "")
39 |
40 | End Sub
41 |
42 | Public Sub OpenFile(ByVal _filepath As String)
43 |
44 | ' ""
45 |
46 | On Error Resume Next
47 | filepath = _filepath
48 |
49 | emvControl.OpenDoc(filepath, False, False, True, "")
50 |
51 | Err.Clear()
52 |
53 | End Sub
54 |
55 | Private Sub Form1_Resize(sender As Object, e As System.EventArgs) Handles Me.Resize
56 |
57 | Me.Refresh()
58 |
59 | Me.DoubleBuffered = True
60 |
61 | End Sub
62 |
63 | End Class
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18 | ' or if you encounter build errors in this file, go to the Project Designer
19 | ' (go to Project Properties or double-click the My Project node in
20 | ' Solution Explorer), and make changes on the Application tab.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.Edrawing2019.Form1
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Form1
5 | false
6 | 0
7 | true
8 | 0
9 | 0
10 | true
11 |
12 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System.Reflection
2 | Imports System.Runtime.InteropServices
3 |
4 | ' General Information about an assembly is controlled through the following
5 | ' set of attributes. Change these attribute values to modify the information
6 | ' associated with an assembly.
7 |
8 | ' Review the values of the assembly attributes
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
20 |
21 |
22 | ' Version information for an assembly consists of the following four values:
23 | '
24 | ' Major Version
25 | ' Minor Version
26 | ' Build Number
27 | ' Revision
28 | '
29 | ' You can specify all the values or you can default the Build and Revision Numbers
30 | ' by using the '*' as shown below:
31 | '
32 |
33 |
34 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Edrawing2019.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.Edrawing2019.My.MySettings
68 | Get
69 | Return Global.Edrawing2019.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/My Project/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
59 |
60 |
61 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/edDWHost.Designer.vb:
--------------------------------------------------------------------------------
1 | Partial Class edDWHost
2 | Inherits System.Windows.Forms.AxHost
3 |
4 | _
5 | Public Sub New(ByVal container As System.ComponentModel.IContainer)
6 | MyClass.New()
7 |
8 | 'Required for Windows.Forms Class Composition Designer support
9 | If (container IsNot Nothing) Then
10 | container.Add(Me)
11 | End If
12 |
13 | End Sub
14 |
15 | _
16 | Public Sub New()
17 | MyBase.New("{22945A69-1191-4DCF-9E6F-409BDE94D101}")
18 |
19 | 'This call is required by the Component Designer.
20 | InitializeComponent()
21 |
22 | End Sub
23 |
24 | 'Component overrides dispose to clean up the component list.
25 | _
26 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
27 | Try
28 | If disposing AndAlso components IsNot Nothing Then
29 | components.Dispose()
30 | End If
31 | Finally
32 | MyBase.Dispose(disposing)
33 | End Try
34 | End Sub
35 |
36 | 'Required by the Component Designer
37 | Private components As System.ComponentModel.IContainer
38 |
39 | 'NOTE: The following procedure is required by the Component Designer
40 | 'It can be modified using the Component Designer.
41 | 'Do not modify it using the code editor.
42 | _
43 | Private Sub InitializeComponent()
44 | components = New System.ComponentModel.Container()
45 | End Sub
46 |
47 | End Class
48 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/edDWHost.vb:
--------------------------------------------------------------------------------
1 | Imports EModelView
2 |
3 | Public Class edDWHost
4 | Private ocx As EModelViewControl
5 |
6 | Protected Overrides Sub AttachInterfaces()
7 | MyBase.AttachInterfaces()
8 | ocx = MyBase.GetOcx()
9 | ocx.EnableFeatures = 16
10 |
11 | End Sub
12 |
13 | End Class
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/refDll/EModelView.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/eDrawingDLL/refDll/EModelView.dll
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/refDll/eDrawingHostControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/eDrawingDLL/refDll/eDrawingHostControl.dll
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/eDrawingDLL/refDll/edrawing help.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/CSharpAndSolidWorks/eDrawingDLL/refDll/edrawing help.zip
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/screenClass/GetWindowsSize.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Runtime.InteropServices;
4 |
5 | using WINDOWINFO = CSharpAndSolidWorks.tagWINDOWINFO;
6 |
7 | namespace CSharpAndSolidWorks
8 | {
9 | internal class GetWindowsSize
10 | {
11 | [DllImport("user32.dll", SetLastError = true)]
12 | private static extern bool GetWindowInfo(IntPtr hwnd, ref WINDOWINFO pwi);
13 |
14 | public struct windsize
15 | {
16 | public double _width;
17 | public double _height;
18 | }
19 |
20 | public windsize GetSize(string ProcessName)
21 | {
22 | windsize myWinSize = new windsize();
23 | Process[] ps = Process.GetProcessesByName(ProcessName);
24 | foreach (var p in ps)
25 | {
26 | IntPtr handle = p.MainWindowHandle;
27 | WINDOWINFO info = new WINDOWINFO();
28 | info.cbSize = (uint)Marshal.SizeOf(info);
29 | GetWindowInfo(handle, ref info);
30 |
31 | myWinSize._width = info.rcWindow.right - info.rcWindow.left;
32 | myWinSize._height = info.rcWindow.bottom - info.rcWindow.top;
33 |
34 | // return info;
35 | // MessageBox.Show(info.rcWindow.left.ToString() + ":" + info.rcWindow.top.ToString());
36 | }
37 | return myWinSize;
38 | }
39 | }
40 |
41 | [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
42 | public struct tagWINDOWINFO
43 | {
44 | /// DWORD->unsigned int
45 | public uint cbSize;
46 |
47 | /// RECT->tagRECT
48 | public tagRECT rcWindow;
49 |
50 | /// RECT->tagRECT
51 | public tagRECT rcClient;
52 |
53 | /// DWORD->unsigned int
54 | public uint dwStyle;
55 |
56 | /// DWORD->unsigned int
57 | public uint dwExStyle;
58 |
59 | /// DWORD->unsigned int
60 | public uint dwWindowStatus;
61 |
62 | /// UINT->unsigned int
63 | public uint cxWindowBorders;
64 |
65 | /// UINT->unsigned int
66 | public uint cyWindowBorders;
67 |
68 | /// ATOM->WORD->unsigned short
69 | public ushort atomWindowType;
70 |
71 | /// WORD->unsigned short
72 | public ushort wCreatorVersion;
73 | }
74 |
75 | [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
76 | public struct tagRECT
77 | {
78 | /// LONG->int
79 | public int left;
80 |
81 | /// LONG->int
82 | public int top;
83 |
84 | /// LONG->int
85 | public int right;
86 |
87 | /// LONG->int
88 | public int bottom;
89 | }
90 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/screenClass/MonitorInfo.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Runtime.InteropServices;
4 |
5 | namespace CSharpAndSolidWorks
6 | {
7 | public static class MonitorInfo
8 | {
9 | [DllImport("user32.dll")]
10 | [return: MarshalAs(UnmanagedType.Bool)]
11 | public static extern bool EnumDisplayDevices(string lpDevice, uint iDevNum, ref DISPLAY_DEVICE lpDisplayDevice, uint dwFlags);
12 |
13 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
14 | public struct DISPLAY_DEVICE
15 | {
16 | [MarshalAs(UnmanagedType.U4)]
17 | public int cb;
18 |
19 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
20 | public string DeviceName;
21 |
22 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
23 | public string DeviceString;
24 |
25 | [MarshalAs(UnmanagedType.U4)]
26 | public DisplayDeviceStateFlags StateFlags;
27 |
28 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
29 | public string DeviceID;
30 |
31 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
32 | public string DeviceKey;
33 | }
34 |
35 | [Flags]
36 | public enum DisplayDeviceStateFlags
37 | {
38 | AttachedToDesktop = 0x1,
39 | MultiDriver = 0x2,
40 | PrimaryDevice = 0x4,
41 | MirroringDriver = 0x8,
42 | VGACompatible = 0x10,
43 | Removable = 0x20,
44 | ModesPruned = 0x8000000,
45 | Remote = 0x4000000,
46 | Disconnect = 0x2000000
47 | }
48 |
49 | public static bool GetPhysicalSize(string deviceName, out int width, out int height)
50 | {
51 | width = height = 0;
52 | try
53 | {
54 | DISPLAY_DEVICE device;
55 | if (!GetDeviceByName(deviceName, out device))
56 | return false;
57 |
58 | var edid = GetEdid(device);
59 | if (edid == null)
60 | return false;
61 |
62 | width = ((edid[68] & 0xF0) << 4) + edid[66];
63 | height = ((edid[68] & 0x0F) << 8) + edid[67];
64 | return true;
65 | }
66 | catch
67 | {
68 | return false;
69 | }
70 | }
71 |
72 | public static byte[] GetEdid(DISPLAY_DEVICE device)
73 | {
74 | RegistryKey key = null;
75 | try
76 | {
77 | var split = device.DeviceID.Split('\\');
78 | var monitor = split[1];
79 | var driver = string.Join("\\", split[2], split[3]);
80 | key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Enum\Display\" + monitor);
81 | foreach (var sub in key.GetSubKeyNames())
82 | {
83 | RegistryKey key2 = null;
84 | RegistryKey key3 = null;
85 | try
86 | {
87 | key2 = key.OpenSubKey(sub);
88 | if (string.Compare(driver, key2.GetValue("Driver") as string, StringComparison.InvariantCultureIgnoreCase) == 0)
89 | {
90 | key3 = key2.OpenSubKey("Device Parameters");
91 | return key3.GetValue("EDID") as byte[];
92 | }
93 | }
94 | finally
95 | {
96 | if (key2 != null)
97 | key2.Close();
98 | if (key3 != null)
99 | key3.Close();
100 | }
101 | }
102 | return null;
103 | }
104 | finally
105 | {
106 | if (key != null)
107 | key.Close();
108 | }
109 | }
110 |
111 | public static bool GetDeviceByName(string deviceName, out DISPLAY_DEVICE device)
112 | {
113 | var dd = new DISPLAY_DEVICE();
114 | dd.cb = Marshal.SizeOf(dd);
115 | uint id = 0;
116 | while (EnumDisplayDevices(null, id, ref dd, 0))
117 | {
118 | dd.cb = Marshal.SizeOf(dd);
119 | id++;
120 | if (!deviceName.StartsWith(dd.DeviceName))
121 | continue;
122 |
123 | var ddMon = new DISPLAY_DEVICE();
124 | ddMon.cb = Marshal.SizeOf(ddMon);
125 | if (EnumDisplayDevices(dd.DeviceName, 0, ref ddMon, 0))
126 | {
127 | device = ddMon;
128 | return true;
129 | }
130 | }
131 | device = new DISPLAY_DEVICE();
132 | return false;
133 | }
134 | }
135 | }
--------------------------------------------------------------------------------
/CSharpAndSolidWorks/screenClass/MyScreen.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Drawing;
5 | using System.Management;
6 |
7 | namespace CSharpAndSolidWorks
8 | {
9 | public class MyScreen
10 | {
11 | public virtual List GetMonitorPnpDeviceId()
12 | {
13 | List rt = new List();
14 | using (ManagementClass mc = new ManagementClass("Win32_DesktopMonitor"))
15 | {
16 | using (ManagementObjectCollection moc = mc.GetInstances())
17 | {
18 | foreach (var o in moc)
19 | {
20 | var each = (ManagementObject)o;
21 | object obj = each.Properties["PNPDeviceID"].Value;
22 | if (obj == null)
23 | continue;
24 |
25 | rt.Add(each.Properties["PNPDeviceID"].Value.ToString());
26 | }
27 | }
28 | }
29 |
30 | return rt;
31 | }
32 |
33 | public virtual byte[] GetMonitorEdid(string monitorPnpDevId)
34 | {
35 | return (byte[])Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\" + monitorPnpDevId + @"\Device Parameters", "EDID", new byte[] { });
36 | }
37 |
38 | //获取显示器物理尺寸(cm)
39 | public virtual SizeF GetMonitorPhysicalSize(string monitorPnpDevId)
40 | {
41 | byte[] edid = GetMonitorEdid(monitorPnpDevId);
42 | if (edid.Length < 23)
43 | return SizeF.Empty;
44 |
45 | return new SizeF(edid[21], edid[22]);
46 | }
47 |
48 | //通过屏显示器理尺寸转换为显示器大小(inch)
49 | public static float MonitorScaler(SizeF moniPhySize)
50 | {
51 | double mDSize = Math.Sqrt(Math.Pow(moniPhySize.Width, 2) + Math.Pow(moniPhySize.Height, 2)) / 2.54d;
52 | return (float)Math.Round(mDSize, 1);
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Paine-Zeng
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PaineTool/AddinIcon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/AddinIcon.bmp
--------------------------------------------------------------------------------
/PaineTool/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | //
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | //
8 | [assembly: AssemblyTitle("")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | //
18 | // Version information for an assembly consists of the following four values:
19 | //
20 | // Major Version
21 | // Minor Version
22 | // Build Number
23 | // Revision
24 | //
25 | // You can specify all the values or you can default the Revision and Build Numbers
26 | // by using the '*' as shown below:
27 |
28 | [assembly: AssemblyVersion("1.0.*")]
29 |
30 | //
31 | // In order to sign your assembly you must specify a key to use. Refer to the
32 | // Microsoft .NET Framework documentation for more information on assembly signing.
33 | //
34 | // Use the attributes below to control which key is used for signing.
35 | //
36 | // Notes:
37 | // (*) If no key is specified, the assembly is not signed.
38 | // (*) KeyName refers to a key that has been installed in the Crypto Service
39 | // Provider (CSP) on your machine. KeyFile refers to a file which contains
40 | // a key.
41 | // (*) If the KeyFile and the KeyName values are both specified, the
42 | // following processing occurs:
43 | // (1) If the KeyName can be found in the CSP, that key is used.
44 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
45 | // in the KeyFile is installed into the CSP and used.
46 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
47 | // When specifying the KeyFile, the location of the KeyFile should be
48 | // relative to the project output directory which is
49 | // %Project Directory%\obj\. For example, if your KeyFile is
50 | // located in the project directory, you would specify the AssemblyKeyFile
51 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
52 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
53 | // documentation for more information on this.
54 | //
55 | [assembly: AssemblyDelaySign(false)]
56 | [assembly: AssemblyKeyFile("")]
57 | [assembly: AssemblyKeyName("")]
--------------------------------------------------------------------------------
/PaineTool/FeatureIcon.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/FeatureIcon.bmp
--------------------------------------------------------------------------------
/PaineTool/MyPMPControl.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace PaineTool
2 | {
3 | partial class MyPMPControl
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要修改
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.button1 = new System.Windows.Forms.Button();
32 | this.checkBox1 = new System.Windows.Forms.CheckBox();
33 | this.SuspendLayout();
34 | //
35 | // button1
36 | //
37 | this.button1.Location = new System.Drawing.Point(18, 18);
38 | this.button1.Name = "button1";
39 | this.button1.Size = new System.Drawing.Size(99, 33);
40 | this.button1.TabIndex = 0;
41 | this.button1.Text = "button1";
42 | this.button1.UseVisualStyleBackColor = true;
43 | //
44 | // checkBox1
45 | //
46 | this.checkBox1.AutoSize = true;
47 | this.checkBox1.Location = new System.Drawing.Point(18, 69);
48 | this.checkBox1.Name = "checkBox1";
49 | this.checkBox1.Size = new System.Drawing.Size(80, 17);
50 | this.checkBox1.TabIndex = 1;
51 | this.checkBox1.Text = "checkBox1";
52 | this.checkBox1.UseVisualStyleBackColor = true;
53 | //
54 | // MyPMPControl
55 | //
56 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
57 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
58 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
59 | this.Controls.Add(this.checkBox1);
60 | this.Controls.Add(this.button1);
61 | this.Name = "MyPMPControl";
62 | this.Size = new System.Drawing.Size(199, 123);
63 | this.ResumeLayout(false);
64 | this.PerformLayout();
65 |
66 | }
67 |
68 | #endregion
69 |
70 | private System.Windows.Forms.Button button1;
71 | private System.Windows.Forms.CheckBox checkBox1;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/PaineTool/MyPMPControl.cs:
--------------------------------------------------------------------------------
1 | using PaineTool.NewFeature;
2 | using System.Drawing;
3 | using System.Windows.Forms;
4 |
5 | namespace PaineTool
6 | {
7 | public partial class MyPMPControl : UserControl
8 | {
9 | public NewFeaturePMPage pmPage;
10 |
11 | public MyPMPControl(NewFeaturePMPage pMPage)
12 | {
13 | InitializeComponent();
14 | pmPage = pMPage;
15 | BackColor = Color.FromArgb(247, 247, 247);
16 | // Size = new Size(270, 379);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/PaineTool/MyPMPControl.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/PaineTool/NewFeature/EnumItem.cs:
--------------------------------------------------------------------------------
1 | namespace PaineTool.NewFeature
2 | {
3 | public enum PMPResultStatus
4 | {
5 | CreateFeautre_Ok,
6 | CreateFeautre_Cancel,
7 | EditFeautre_OK,
8 | EditFeautre_Cancel
9 | }
10 | }
--------------------------------------------------------------------------------
/PaineTool/NewFeature/FaceEdgeInfos.cs:
--------------------------------------------------------------------------------
1 | using SolidWorks.Interop.sldworks;
2 |
3 | namespace PaineTool.NewFeature
4 | {
5 | public class FaceEdgeInfos
6 | {
7 | public Edge edge { get; set; }
8 | public double dim { get; set; }
9 | public double Angle { get; set; }
10 | public double Length { get; set; }
11 | public double chuizuPoint_X { get; set; }
12 | public double chuizuPoint_Y { get; set; }
13 |
14 | public FaceEdgeInfos()
15 | {
16 | }
17 |
18 | public FaceEdgeInfos(Edge edge, double dim, double angle, double length, double chuizu_x, double chuizu_y)
19 | {
20 | this.edge = edge;
21 | this.dim = dim;
22 | Angle = angle;
23 | Length = length;
24 | chuizuPoint_X = chuizu_x;
25 | chuizuPoint_Y = chuizu_y;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/PaineTool/SwAddin.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/SwAddin.cs
--------------------------------------------------------------------------------
/PaineTool/mainicon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/mainicon_128.png
--------------------------------------------------------------------------------
/PaineTool/mainicon_20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/mainicon_20.png
--------------------------------------------------------------------------------
/PaineTool/mainicon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/mainicon_32.png
--------------------------------------------------------------------------------
/PaineTool/mainicon_40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/mainicon_40.png
--------------------------------------------------------------------------------
/PaineTool/mainicon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/mainicon_64.png
--------------------------------------------------------------------------------
/PaineTool/mainicon_96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/mainicon_96.png
--------------------------------------------------------------------------------
/PaineTool/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/PaineTool/toolbar128x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/toolbar128x.png
--------------------------------------------------------------------------------
/PaineTool/toolbar20x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/toolbar20x.png
--------------------------------------------------------------------------------
/PaineTool/toolbar32x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/toolbar32x.png
--------------------------------------------------------------------------------
/PaineTool/toolbar40x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/toolbar40x.png
--------------------------------------------------------------------------------
/PaineTool/toolbar64x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/toolbar64x.png
--------------------------------------------------------------------------------
/PaineTool/toolbar96x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/PaineTool/toolbar96x.png
--------------------------------------------------------------------------------
/README.en.md:
--------------------------------------------------------------------------------
1 | # CSharpAndSolidWorks
2 |
3 | #### Description
4 | Solidworks 二次开发基础资料库
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ###SolidWorks API
2 |
3 |
4 |
5 | 
6 |
7 |
8 |
9 | ```
10 | #API
11 | 连接Solidworks
12 | 打开和创建新零件
13 | 读取零件属性
14 | 修改零件
15 | 遍历零件特征
16 | 遍历装配体
17 | 遍历工程图视图与球标
18 | 装配新零件
19 | 导出x_t/dwg
20 | 插入库特征
21 | 选择过滤
22 | 清空草图的几何关系
23 | 选择命名的实体/面
24 | 遍历草图中的对象
25 | 给文件增加第三方属性
26 | 显示提示信息
27 | 高级选择
28 | 包围框生成(包括装配体方案)
29 | 测量与获取结果
30 | 获取质量属性
31 | Add-in的建立
32 | 自动注册插件与更新方案
33 | Pane创建页面(预览BOM)
34 | 给零件加上材质
35 | 给选定面增加颜色
36 | 打断连接关系
37 | 替换零件
38 | PMP新特征
39 | 显示拖拽
40 | MacroFeature的生成
41 | 等待用户选择后继续操作
42 | 打包文件Pack and Go
43 | 插入块 和 属性块
44 | 工程图中获取模型
45 | 给已有特征增加几何关系
46 | #实例
47 | 创建草图中心点
48 | 自增Note插入
49 | 球标位置自动优化
50 | 批量导出实体,生成新装配体。
51 | 随机上色
52 | 屏幕1:1显示实物
53 | ```
54 |
--------------------------------------------------------------------------------
/Solidworks API Help CN.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/Solidworks API Help CN.xlsx
--------------------------------------------------------------------------------
/TMYTest.SLDPRT:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/TMYTest.SLDPRT
--------------------------------------------------------------------------------
/dll/ConnectToSolidworks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/ConnectToSolidworks.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.SWRoutingLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.SWRoutingLib.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.cosworks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.cosworks.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.sldworks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.sldworks.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.sw3dprinter.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.sw3dprinter.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.swcommands.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.swcommands.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.swconst.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.swconst.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.swdimxpert.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.swdimxpert.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.swdocumentmgr.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.swdocumentmgr.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.swmotionstudy.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.swmotionstudy.dll
--------------------------------------------------------------------------------
/dll/SolidWorks.Interop.swpublished.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorks.Interop.swpublished.dll
--------------------------------------------------------------------------------
/dll/SolidWorksTools.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/dll/SolidWorksTools.dll
--------------------------------------------------------------------------------
/v.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/v.png
--------------------------------------------------------------------------------
/如何测试.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/painezeng/CSharpAndSolidWorks/c8dd32d0677ead1e33e5f36410dd7e122e17c2fd/如何测试.mp4
--------------------------------------------------------------------------------