Solved

Solidworks API Woes

Posted on 2010-11-22
1
1,900 Views
Last Modified: 2013-12-04
Hello,

I am having problems with the Solidworks 2010 API... I downloaded the SDK but I noticed on install it is giving me no options at all. Then when I try to use the wizard to create a project the c# options are not available (oddly only C++ has any solidworks options).

So I tried to directly bring in the 3 .tlb files listed here: http://help.solidworks.com/2010/English/api/sldworksapiprogguide/Overview/Using_SolidWorks_C__Add-In_Wizard_to_Create_C__Add-In.htm?id=20e09cfafe034f35a42c9e4784652402

When I do that I can bring the references in by directly browsing to the solidworks directory or by the COM manager.  However when I do this I still cannot use any of the solidworks functions, not even the using statements are recognized.

In conclusion: Help!

Edit:
 I un-registered and re-registered the .tlb files and no luck.

Also here is an image which may shed some light on the issue
http://mytheral.squarespace.com/storage/visual_studio.PNG

Edit2:
on compile I get these errors:

Error    1    The type or namespace name 'SolidWorks' could not be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\...\My Documents\Visual Studio 2008\Projects\ClassLibrary2\Class1.cs    19    7    Solidworks_Plugin
Error    2    The type or namespace name 'SolidWorks' could not be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\...\My Documents\Visual Studio 2008\Projects\ClassLibrary2\Class1.cs    20    7    Solidworks_Plugin
Error    3    The type or namespace name 'SolidWorks' could not be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\...\My Documents\Visual Studio 2008\Projects\ClassLibrary2\Class1.cs    21    7    Solidworks_Plugin
Error    4    'SldWorks' is a 'namespace' but is used like a 'type'    C:\Documents and Settings\jacob.j.shaffer\My Documents\Visual Studio 2008\Projects\ClassLibrary2\Class1.cs    94    16    Solidworks_Plugin

edit3:
 also as an example if I use "using SolidWorks.Interop.sldworks;" or "using Interop.sldworks;" or even just "using sldworks;" it gives me the exact same error. Got the idea to try this from looking at the object browser... which the methods appear to be in there without the initial "SolidWorks".
0
Comment
Question by:eXMytheral
1 Comment
 

Accepted Solution

by:
eXMytheral earned 0 total points
ID: 34197268
Turns out that the fix was importing the libraries from .Net instead of browsing directly to the .tlb files. Teach me to trust the installation docs which said that VS would sort out which version I needed.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now