Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

BEST APPROACH FOR API LEARNING 1

Status
Not open for further replies.

murugansubham

Mechanical
Sep 24, 2003
89
Hi all,
i know VB6 upto database connectivity concepts. i don't know COM concepts in VB6.Just now i've started to study SolidWorks -API concepts myself.i'm refering SolidWorks help and studying.
I hve seen there r three types of API programming.
1) through VC++
2) through VB.
3) through MACRO. (Visual Basic Application like M.S Exell MACRO- VB Editor)
Is there any best appoarch to study the API concepts?
Can u give me good web site details for downloading the API Tutorials?
do u have any tutorials for API concepts?
THANK YOU,

regards,
murugan.S
Design Engineer,
GlobalSoft Pvt Ltd,
INDIA
murugan_subham@rediffmail.com
 
Replies continue below

Recommended for you

I recommend to all people who wish to learn SW API that they first learn Visual Basic (VB6) or VBA. There are many books available to teach yourself VB. Check amazon.com. Many of these books come with a "Working model" version of VB, as well.

Once one is comfortable with VB, learning SW API comes much easier. It is easier to understand the examples in the help and it is easier to follow the code resulting from recording a macro.

[bat]"Great ideas need landing gear as well as wings."--C. D. Jackson [bat]
 
From my experience, I don't think you need to learn much of VB (that is, don't buy a very expensive or very technical VB book - try one for biginners).
The most important (I am guessing that you have some programming skills) is to know the concepts of VB and the concept of object oriented programming (for me, used to "traditional" programming, it was the most triky part).
Then download the VB examples from SW site, download macros from the many sites on wich they are available and test them, make simple modifications. Record macos of things you want to do and see the generated code. Also take a look at the API help of SW: it really helps.
With the concepts and with some experiments you will soon be able to do program your macros.

C++ is more for gurus.

Regards
 
Right, macPT. One doesn't need to be expert at VB. However, one should be "VB literate" going into learning API.

Key concepts that can trip up beginners (or people accustomed to "linear" programming like FORTRAN):
•object oriented programming, especially understanding objects' methods and properties
•variable scope
•data types-- many SW API calls are sensitive to what data type (string, boolean, variant) are used for return variables

There is a SW API tutorial available through
 
thanks.... thetick and macpt.
actually i've some knowledge in object oriented programming.
i did 10 projects using AutoLISP.
i 've worked some VB , ASP projects also.
i think , i can manage.

my question is how to approach Solidworks -API.
i am able to understand the solidworks API coding.
But main problem in help is they have given lot of events, methods, objects. it is confusing me.

which method is good?

1)observing and studying API coding from example programs. ( from coding, we can refer particular method, events, object in solidworks api help.)

2)studying through help contents step by step.

thanks,

regards,
murugan.S
Design Engineer,
GlobalSoft Pvt Ltd,
INDIA
murugan_subham@rediffmail.com



 
thanks thetick. the website that u 've given for solidwork api tutorial is very nice.
thanks,

regards,
murugan.S
Design Engineer,
GlobalSoft Pvt Ltd,
INDIA
murugan_subham@rediffmail.com





 
I generally map out what I want to do in a flow chart outline that specifically references SW commands, functions, etc. Then I consult with the help file regarding the particular API calls/functions that I need to use to accomplish my task. Certainly you'll want to take advantage of any sample code or examples that are provided. Also if you look in your SW installation directory there are a couple of sample VB applications that you can look at and step through.

Hope this helps some,



Chris Gervais
Sr. Mechanical Designer
Lytron Corp.
 
thanks for kind reply RawheadRex .i can follow the things u suggest.
thanks,

regards,
murugan.S
Design Engineer,
GlobalSoft Pvt Ltd,
INDIA
murugan_subham@rediffmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor