×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Matlab-SolidWorks interaction API

Matlab-SolidWorks interaction API

Matlab-SolidWorks interaction API

(OP)
I've been trying to use Solidlab matlab routines that i downloaded from here, without success. According to the description it is supposed to work on windows XP+Matlab+SolidWorks 2006 SP4.1. I've tried with Matlab 6.5 & 7 and SolidWorks 2011 & 2006 SP0.0-instead of SP4.1. All my tryouts came across "Run-time error '91':Object variable or With block variable not set" errors after initializating and opening the test model! Is there any idea of how to transcend these problems, or any other priceless equivalent API?

RE: Matlab-SolidWorks interaction API

You might try stepping through the VB code in the macro editor.
SW makes changes to the API from year to year. You might have to go through line by line and check that.

I noticed that a call to preferences was in the VB. Preferences calls have made some changes over the year.  

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: Matlab-SolidWorks interaction API

It sounds like you have a references problem.  From the VBA editor, go to Tools->References, look at the ones that are checked but marked as "MISSING" that reference the old version of SolidWorks.  Find the corresponding references for your version of SolidWorks and check the boxes.

-handleman, CSWP (The new, easy test)

RE: Matlab-SolidWorks interaction API

(OP)
Thanks for the responses. I 'd like some more advice because i'm not that experienced at programming. First of all I want to count out one by one some basic issues in order to focus on the matters that need to be solved.
Concerning matlab edition, I now think that it's not the source of the whole problem weather I use 6.5 or 7, right?
Secondly, i want to mention that none of the "solidlab" files seems to be recognized by the macro editor, as they are neither .swp nor .swb , but .bas .vbp .vbw etc. Also, the VBA editor that I use [visual studio 6] doesn't have references option under Tools menu.
So what I have to do is to give commands in matlab and check line by line the execution of the code, hoping to find any syntax error of a function or a value that corrupts the debugging process.
Could it be that simple?
 

RE: Matlab-SolidWorks interaction API

You go to the .bas files, copy them and paste them into a blank SW macro. I think you have to clean out a few statements at the beginning.  Then step through. Since his VB doesn't use early binding you may not need to do much in Tools/References since it looks like Suresh is just using SW calls.

I'm wondering if this will work with my Matlab work-a-likes.

BTW, Krishnan Suresh' website is pretty cool stuff.  

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."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources