What is API

Prolog

As a start for all newbie in programming, I will try to simplify as much as I could what Revit API is and the concept behind its implementation.

Let me explain What is API through a story. let's say you you have a car and the car needs maintenance, but you know nothing about car maintenance. so how you would fix this. logically, you would go to a garage asking the Mechanical Engineer for a fixation. the Mech. Eng. would start opening the hood doing a maintenance and then back to you saying your car is ready.
so the analogy of this we can say:

You : User
Mech Eng.: Interface.
Car: Application

So we can say you have interfaced you Car through a Mech. Eng. to apply a function (maintenance).

But, what if you asked this Mech. Eng. to create a button on your display panel, that boost your car.
and that is called additional feature. Turning this to Computer Science World, that is called API. It is like sending a request message to an application to do something and return back to you with the result.

WikiPedia defined API as

An application programming interface is an interface or communication protocol between different parts of a computer program intended to simplify the implementation and maintenance of software. An API may be for a web-based system, operating system, database system, computer hardware, or software library. Wikipedia
API infographic
A graphical explanation of how API works ref:govTech

Conclusion

with that said, I guess it is now more clear what API is, which if reflected on Revit, it would be defined as an application that will trigger functions already implemented inside the hood of Revit, to do what it is allowed to do to serve our needs.

In short, your role would be similar to the Mech. Eng. who writes API application to connect a user to Revit.

see you on a next post.

No comments:

Post a Comment

WPF-Revit -01

In this post, we are going to surface explore WPF structure and how to use it within Revit App. Windows Platform Foundation WPF ...