API C# STARTING PROBLEM
API C# STARTING PROBLEM
(OP)
Hi
I'm new in SolidWorks API programing.I'm working in C# programing language. I made some programs and this programs work well. But I have a problem with a programs example from SolidWorks API HELP. I copy the program code from HELP and paste it in SolidWorks API editor. When I run this program there are four mistakes:
1. Error 1 'Macro1.csproj.SolidWorksMacro' does not contain a definition for 'swApp'
2.Error 2 The name 'Main' does not exist in the current context
3.Error 3 'Macro1.csproj.SolidWorksMacro' does not contain a definition for 'swApp'
4.Error 4 The name 'Main' does not exist in the current context
Please help me how can I fix this problem
I'm new in SolidWorks API programing.I'm working in C# programing language. I made some programs and this programs work well. But I have a problem with a programs example from SolidWorks API HELP. I copy the program code from HELP and paste it in SolidWorks API editor. When I run this program there are four mistakes:
1. Error 1 'Macro1.csproj.SolidWorksMacro' does not contain a definition for 'swApp'
2.Error 2 The name 'Main' does not exist in the current context
3.Error 3 'Macro1.csproj.SolidWorksMacro' does not contain a definition for 'swApp'
4.Error 4 The name 'Main' does not exist in the current context
Please help me how can I fix this problem






RE: API C# STARTING PROBLEM
I solved this problem, but I have the new one.
Please sameone write the short program in C# which it will open the file C:\model.sldprt.
I don't know how can I use OpenDoc6, because the examples for open document from API Help don,t work.
RE: API C# STARTING PROBLEM
TOP
CSWP, BSSE
www.engtran.com www.niswug.org
www.linkedin.com/in/engineeringtransport
Phenom IIx6 1100T = 8GB = FX1400 = XP64SP2 = SW2009SP3
"Node news is good news."
RE: API C# STARTING PROBLEM
RE: API C# STARTING PROBLEM
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim Part As ModelDoc2
Dim Measure As Measure
Dim boolstatus As Boolean
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set Measure = Part.Extension.CreateMeasure
Debug.Print "Distance: " & Measure.Distance
End Sub
That would be very helpful for me.
RE: API C# STARTING PROBLEM
TOP
CSWP, BSSE
www.engtran.com www.niswug.org
www.linkedin.com/in/engineeringtransport
Phenom IIx6 1100T = 8GB = FX1400 = XP64SP2 = SW2009SP3
"Node news is good news."
RE: API C# STARTING PROBLEM
But you can't record above program.
This above program get the distance between two selected entities (in VBA).
I don't know how this get in C#. But I realy need this data in C#.
Please help me.