PDA

View Full Version : Where do I start?



sfaust
2007-09-11, 12:03 AM
Ok, so I am quite experienced with Revit (+/- 6 years) but I am VERY inexperienced with programming (read: essentially no experience) but I usually pick up on computer stuff pretty quickly. Anyway, I would like to be able to use the API to do at least some basic things and make some little tools on my own.

So my question to those of you who are good at this is: where should I start? I don't really want to do a lot of fancy stuff, just basics. What language should I look at? Where is a good place to learn? Any other suggestions for me?

Thanks,
Steve

Steve_Stafford
2007-09-11, 08:02 AM
I'm sure that Guy or Danny would be better suited for a reply but if I were in your shoes I'd probably focus on learning C# (CeeSharp) as it was developed for .net if I have my facts straight. From what little I've read C# is supposed to have a number of advantages over the other choices because it is a newer language. Revit is developed in C++. You can technically write code in any number of development languages as long as they are .net versions.

Another possible candidate would be Visual Basic. I did some hacking, wouldn't call it real programming, a few years back using Visual Basic and I was able to figure out how to do what I wanted but I wouldn't call it easy either. Learning to use programming languages is a whole discipline/career unto itself, you'd do well to pick up some books on the basic concepts of programming and then pick a language to focus on. I enjoyed a book called Code Complete (http://www.cc2e.com/) which is an insiders look at the world of programming and how things go wrong and best practices etc.

There are also quite a large number of examples you can examine on the Revit CD. I don't recall which language they are in...VB? help...Guy? Danny? I seem to recall a similar thread sometime in the past here.

You'll probably inevitably start with the traditional "Hello World" routine :smile:

clog boy
2007-09-11, 02:02 PM
Microsoft has some free developer stuff, Visual Studio Basic or something, in which you can build windows (read: drag around with buttons etc). The tricky part is to write some code (functions) to make the buttons do what you want.
Do you have webdesign experience? I think building forms and make them interact with Javascript, getting yourself familiar with the Document Object Model and basic JS functions, are a good crash course. I might be wrong ofcourse, since I gave up programming after the first few basic tutorials. (am learning JS now tho)
I'm told Visual Basic and C# are very similar to writing macros for Word and Excel.
To be honest, I don't even know how to make an API work with Revit, which is supposed to be the easy part.

Good luck and have fun. I'll keep an eye on this thread.

LRaiz
2007-09-11, 02:29 PM
Unless you want to change your profession then save your time and stick to architecture. I think it is silly to expect that a non-professional programmer might be able to develop anything significant in for an application as complicated as Revit.

dpasa
2007-09-11, 03:07 PM
Correct LRaiz, I did some very nice things with AutoLisp but this is completely different, I was using Turbo Pascal in the past, a much better and easier prog. language than VB and C#. Then it changed to Delphi, very powerful but I had to learn programming in Windows... Sorry, I am not a programmer... I guess everything goes too fast now for amateurs.

Brian Myers
2007-09-11, 05:07 PM
Not to lead this thread off-track, but since it seems that the general thought is to "not do this at home" are there any good resources you would recommend for this customized app content? Not programming, but a resource to either download or purchase existing API applications/tools for Revit?

Prodev75
2007-09-11, 05:18 PM
Plenty of information out there on programming. Search the web, buy a few books do a little research. Books with examples helped me out a lot when I started tinkering around with programming back in 1999. You’ll know soon enough if it’s for you for if it’s even worth learning. After all, even the most advanced of programmers had to start somewhere.

david.kingham
2007-09-11, 07:17 PM
I'm in the same boat Steve, I really don't know programming besides petty stuff like batch files, html and lisp.
From my research it seems the two obvious choices are C# and vb.netTake a look at Danny's pdf from AU (http://www.augi.com/education/auhandouts/2005/BD32-2.pdf)
I decided to start with vb.net because it's easier for newbies to learn.
The syntax is the major difference
C# looks like this:

if() { }
vs.

vb.net:

If .. Then
End If

I ordered this book (http://www.amazon.com/Microsoft-Visual-Basic-NET-Step-Version/dp/0735619050/ref=pd_bbs_sr_1/002-6921164-6915233?ie=UTF8&s=books&qid=1189537709&sr=8-1) , the reviews sounded good for a total newb
You can download VB Express here (http://msdn2.microsoft.com/en-us/express/aa718406.aspx)

I also tried to learn python because it is probably the easiest language to learn, but there are no examples out there except what GuyR is doing, I couldn't figure out how to make the connection between revit and python.
I hope to prove the naysayers wrong by learning this and developing some minor tools, but I definitely have my doubts, this is very hard.

GuyR
2007-09-11, 10:21 PM
The API and .NET target audience is the professional programmer. However, there are many who recognise the immense amount of data contained in a Revit project is ripe for manipulation using an API both to improve the BIM experience and integrate with company standards.

The trouble is to make this powerful tool usable for the masses is a difficult task. Personally, I'm trying hard to find solutions to this problem. Python has been one experiment. A binding to the API has been working for a while. The problem is the (lack of) tools available to write programs for Revit are currently only available with professional tools which defeats the goal of making it available for beginners. I do have a solution of how to solve this but there are a number of reasons this won't happen for a while.

So for now the only option is to learn a standard .NET language , the API and a whole heap of practice. Personally I find c# more readable than VB.NET. Most API samples are in c# and something like 70% of developers using .NET are programming in c#. However, if you have experience of visualbasic then VB.NET will be a better fit. Using online tools you can convert code between c# and VB.NET which helps.

Writing code: One of SharpDevelop22 (http://www.icsharpcode.net/OpenSource/SD/Download/#SharpDevelop22), or VB.NET (http://msdn2.microsoft.com/en-us/express/aa718406.aspx) or C# (http://msdn2.microsoft.com/en-us/express/aa700756.aspx).
Also the SDK contains a lot of samples and documentation, SDK (http://www.microsoft.com/downloads/details.aspx?familyid=FE6F2099-B7B4-4F47-A244-C96D69C35DEC&displaylang=en)

Learning the API:
Danny's pdf and notes from AU are a good start. The API SDK is contained on your installation CD as well as online (http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975). There are samples here on AUGI as well. Start off with compiling the Helloworld sample in the SDK and practice how to debug from your development environment.

Learning .NET:
There are many books and online resources available. I find the Apress series of books generally well written. To do anything basic in Revit you'll need to understand in addition to the basic language how to construct WinForms, raise/consume events as well as understanding the basics of generics.

HTH,

Guy

sfaust
2007-09-12, 12:09 AM
hmm... alright. Thanks for all of your time. It seems that it may take more time that I really have to throw at it, but we'll see... I'll keep you posted :)

thanks for everyone's help.

Steve

Danny Polkinhorn
2007-09-12, 08:57 AM
Steve,

FWIW, it looks like they've taken down all the screencasts from last year. My session was recorded (for good or bad ;)).

Leonid's comments are both true and false. It was probably not his intent for Revit to be a framework for development like AutoCAD (a statement I hope he would agree with). Revit wants to be all-inclusive so that you're not wanting for tools. While the API is very complex (for average joes), it is also quite powerful. As Guy says, if your intent is to pull information from the model (that is the point of BIM isn't it?), then you can certainly do quite powerful things. I'm not a programmer, but I play one on TV and I stayed at a Holiday Inn Express last night. So, I can write applications that tap into the API and do all sorts of wonderful and useful things. In fact, I actually get some pleasure from writing my hokey little apps.

So if you think programming is fun and you want to learn something new, maybe write a few apps, then go for it, you can do it. If you think you can write Revit Civil, you'll need to stick to architecture.

My 2¢ on VB versus C#: I started programming Basic in 1984 so Visual Basic and now VB.NET were easier for me. I can read C#, but writing it gives me headaches. If you don't know VB, go with C#. They tell me it makes for better code. Many, many more opinions here (http://www.google.com/search?q=VB+versus+c%23).

Hope that helps,

clog boy
2007-09-12, 12:21 PM
I'm not a good architectural drafter, my skills and job experience are more in the lines of ICT. But as a profession I'm a CAD-monkey. So you can imagine how thankful I am for Revit to make use of all my skills, both architectural and ICT. That's why I do CAD-developing for an engineering dept.

But programming is beyond my skills, at least at the moment. (webdesign and XML isn't)As one newsletter once stated, architects should be able to hire programmers to write their API's. They can't do their own programming as they did with AutoCAD so it's back to the drawing board. I think there will be programmers very soon filling the gap and specialize in Revit BIM applications. I think there will be webdesigners very soon, not unlike me, manipulating XML- and Access exports for their calculations.