Solved

Solidworks API Woes

Posted on 2010-11-22
1
1,959 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

623 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