My first Revit plugin

January 14th, 2011

Update: The post had to be redacted for the sake of our relationship with the customer. They feel some of their exclusive IP was made public so I removed all reference to data/screenshots that is not publicly available elsewhere – in this case mostly at Building Coder blog.

A few months ago I got the opportunity to do some programming for reasons other than curiosity or fun. A bunch of clever guys came up with a few ideas on how to improve their Revit workflow and they asked us to translate those ideas into code.

The problem
Before I explain what the plug-in does I should take a step back and show what problem it is trying to solve. Revit Clinic touches on that in a bit more detail here, but the short version is that the “Referencing Sheet” parameter always references the first view in which the given section appears. If there are dozens or hundreds of views, hiding the section tag in all but the one that you want, may be a very time consuming and tedious task.

The solution
Quite simple really but unfortunately the details are confidential…

The workaround
When I wrote the first version of that plug-in, it all worked great except for one small part. The problem was that the “Referencing Sheet” parameter was not updated automatically as it should happen – clearly a bug in Revit. Fortunately, the guys at ADN were able to suggest a workaround. A simple trick – changing the discipline of the section view and then bringing it back to what it was originally. Everything within the same transaction! I was quite surprised that it worked but it did so that’s what counts. Here’s a snippet of the code that does that.

Shameless plug
I’ve had tons of fun developing that plug-in and I wouldn’t mind repeating that experience. In fact, I have already created a few other Revit plug-ins and looking forward to creating some more in the future. If you or your company has an idea for a Revit plug-in that would make your life easier let us know through the comment in this blog – I won’t publish those comments to keep your inquiries private.

The thanks
Big “Thank you” goes to Jeremy Tammik and the rest of the AEC DevTech team at ADN. The level of support they provide is amazing and that was a very big part of why I enjoyed working on that plug-in.

I was wrong…

May 22nd, 2010

…but not totally wrong.

In one of my previous posts I speculated that Autodesk is planning to use Qt framework to bring its most important products to other platforms. A few days ago I was proven wrong. Now I know that Autodesk has other plans. Unfortunately I cannot share the details of what I know. All I can say is… stay tuned. There’s more news coming.

On a completely unrelated note, since we almost have winter here in New Zealand I’ll now go and have a cup of hot cocoa in front of the fireplace.

Community website for everything CAD/CAM/CAE/BIM

April 20th, 2010

StackOverflow is an amazing knowledge exchange website for programmers. It is great for a few reasons.

The best (in my opinion) thing about it is the voting/reputation system. Every user can award 1 positive or negative point to every question or answer . Those votes build the reputation of people who ask questions as well as those answering questions. If you just ask good questions they will be voted up and your reputation will grow. Naturally if you provide a good, comprehensive answer it will be also voted up and reward you with lots of reputation points. This causes the best answers to quickly “bubble up” to the top of the list, so if you found this question through Google, you don’t have to dig through the whole discussion on the forum to find what you are possibly looking for. Additionally the person who asked the question can mark one answer as the one they find most helpful for them. This way the best answers get the most attention. It is brilliant in its simplicity and works beautifully.

The next thing about this system is how it accumulates huge amounts of knowledge and makes it easily accessible to anyone. No login is required to explore the website in search for an answer to your problem. The website is also build to be friendly for search engine robots so good questions are easy to find through Google search.

A very important aspect of the StackExchange based systems is that they are vendor agnostic. No company decides which products can or cannot be discussed. There is no marketing beyond real users opinions about a given product. Popular products are popular because they there is a lot of people discussing them not because someone decided that other products are “off topic”.

This is what I think makes StackOverflow work as well as it does and I always thought that the wide CAD community could benefit immensely from having such a website. Now an opportunity emerged to make that reality. Please, support the idea by voting for it here. No matter if you’re using AutoCAD or Microstation, ProE or SolidWorks, Revit or Archicad. A community like that will be a great benefit to everyone.

Links:

StackOverflow: http://www.stackoverflow.com
StackExchange 2.0 announcement: http://blog.stackexchange.com/post/518474918/stack-exchange-2-0
StackExchange for CAD proposal: http://meta.stackexchange.com/questions/5692/proposal-for-engineering-software-se-cad-cam-cae-bim

Autodesk takes AutoCAD and Revit cross-platform

March 31st, 2010

Update: Most of my speculations in this post turned out to be incorrect. Read more here.

I’ve had a draft of this blog post lying around since May 2007. When I first started it, it was titled “AutoCAD on alternative platforms”. It was mostly my thoughts on why it would be good for everyone involved if Autodesk decided to make AutoCAD run on systems other than Windows. Last week, with release of 2011 line-up of its products, Autodesk has deprecated that blog post.  It no longer is a question if Autodesk is going to offer their main products to customers running “alternative” platforms. Now it is just a question of when is it going to be officially announced. If you can’t wait to dump Windows and only AutoCAD/Revit are holding you back, read on and see what the future holds.

Why do you think Autodesk is working on cross-platform versions of AutoCAD and Revit?
A few reasons actually, but one of them leaves no doubt. AutoCAD and Revit 2011 ship with a few core files of the Qt framework. Qt what? I recommend you click the link and read a bit more but long story short it’s a library for building user interfaces that runs on wide range of platforms. All the major desktop ones (Windows, Mac Os X and Linux), but also a number of mobile and embedded systems.

Oh really? How can you tell ?
Go to the main application directory of your AutoCAD or Revit 2011 and see if you can find those files: QtCore4.dll, QtGui4.dll and QtXml4.dll. There you go. The core of the Qt framework inside your Autodesk product. What more evidence do you need?

Seriously? Do they use it already?
Seems like they do. Here’s an error message that was displayed when I renamed one of those files inside the Revit 2011 installation:

Revit error message - Qt library file missing

Revit error message - Qt library file missing

OK, but why does it mean that they *will* release those products on other platforms?

Because that is the only reason that could justify using Qt. It simply wouldn’t make sense to waste time and money to migrate away from native Windows API and not take advantage of what Qt offers. Thanks to using Qt the same code base can be used to build an application running on different platforms, which means reaching new customer base at minimal expense. Seriously, using Qt and not going cross-platforms would be like buying a plane to use it for drag racing instead of flying.

What do you mean by alternative platforms?
Qt can run on pretty much anything that runs on electricity, so possibilities are endless but I think that Autodesk will just dip their toes in cross-platform development by releasing those products on Mac OS X. It already is a reasonably sized market with a high growth rate, so in makes a lot of economic sense. Hopefully, later they’ll also decide to go to Linux as well, but I wouldn’t hold my breath waiting for that to happen.

Why wasn’t it announced officially?
I don’t know, ask Autodesk. Seriously… go and ask. Call, email, send a pigeon. I guess it just the usual mixture of politics and marketing. The news that Maya 2011 is getting a Qt UI was made official long time ago. I hope that we’ll hear more news during the April 19th event but nothing is guaranteed, and even though I would be really disappointed there is a chance that nothing will happen in the 2011 product cycle. We’ll see.

What does it mean in terms of UI look and feel? Is it going to change a lot?
Certainly not in the 2011 cycle since that ship has sailed, but even later not necessarily. It is possible to mix elements of Windows toolkit with parts using Qt framework – Qt widgets can live inside traditional Windows interface and the other way around so the Windows version doesn’t have to change in a major way. I expect the Windows versions to evolve around the same concept that Autodesk was trying to get us used to for the last few versions. Fear not, the ribbon is here to stay.

It’s a different story on the Mac. Qt hasn’t got an equivalent of the ribbon in its toolbox so it will be either replaced by a bit more traditional UI or recreated as a custom widget (which I find hard to believe). With Maya 2011, Autodesk decided to use Qt only on both platforms and it makes a lot of sense if you decide to start from scratch. In case of AutoCAD and Revit both of which have just got nice new interfaces it would be a bit of waste of time and money and in my opinion a step back in terms of visual quality. Below you can see screenshots of the new UI for Maya running on Windows and Mac OS X. I’m not hugely impressed with the result, but for Maya it is probably a step in a good direction. For AutoCAD and Revit that would be a big regress. You shouldn’t also judge Qt by what you see below. It is a very flexible and a highly customizable toolkit and the quality of the interface created with it is completely up to the developer.

Maya 2011 running on Windows

Maya 2011 running on Windows

Maya 2011 running on Mac OS X

Maya 2011 running on Mac OS X

Is Qt the best solution? Cross-platform vs native?
Good question. Unfortunately it is quite hard to define best. In a perfect world, without lawyers and accountants, best would mean fully native version of given application on every platform. While not very cost effective, this is the solution that guarantees the best possible integration of the application with surrounding environment. There are some good examples of this approach. Microsoft’s own Office 2011 for Mac OS X is created as a native Cocoa application. As you can see on those leaked screenshots, they have even recreated the ribbon! Mac version of Mindjet’s MindManager is also a completely native port, providing Mac users with an interface that provides experience similar to other Mac apps. That would be the best solution in a perfect world but that’s not where we are. We already know that Autodesk has gone the Qt way, so let’s just hope that their developers do a good job and get the best out of what they have to work with.

OK. What else?
Have a look here. It’s a web page that lists all the LGPL libraries that Autodesk is using. Since they chose to use the open source version of Qt they are legally obliged to redistribute the libraries that they use. That page alone wouldn’t mean much, since Maya 2011 also has a Qt UI, but we’ve already established that AutoCAD and Revit 2011 actually include those files in the default installation. It will be interesting to keep an eye on this page and see what other open source software Autodesk is going to use.

Final words
Back in 2007 when I researched the topic of AutoCAD running on Linux and Mac, I was hugely surprised with how aggressively current AutoCAD/Revit users were opposed to the idea of Autodesk bringing those products to other platforms. A lot of CAD “pundits” have been displaying an incredibly hostile attitude claiming that by investing in alternative versions of its products Autodesk would lose focus and the quality and the pace of development would suffer from that. This was a very strange thing to see since it pretty much meant that there is a lot of people that are not really happy with the quality/feature set of Autodesk products but they still use them for some reason while waiting for Autodesk to magically fix them. Some of those opinions sounded so demanding that it was obvious that their authors thought that by buying a product they gain shareholder-like powers and rights. I’m happy that Autodesk seems to have ignored those lunatics.

I really hope that Mac OS X versions of AutoCAD and Revit will be announced soon. I’m pretty sure that majority of Autodesk customers will appreciate the freedom of choice of the system in which they have to work every day. A lot of users that have been running Autodesk products in virtualized environments will be relieved that they don’t have to compromise on speed and system integration. For me it means that I’ll be one step close to the dream of coming to work and not booting into Windows.

How much confidence do I have in what I have written here? Well, if I had some loose cash lying around I would certainly buy some Autodesk stock. Implications of going cross-platform will certainly sound very optimistic to investors and once it is all officially announced I’m sure the price of Autodesk shares will go up, probably quite a bit.

Oh, one more thing. If you actually know that anything I have written here is wrong, let me know. I’ll be happy to either correct it or admit that my predictions have been wrong.

Update: I have just confirmed that the same set of Qt files can be found inside Inventor 2011 as well. Looks like Autodesk is planning to go cross-platform with the whole product line. I love it. The sooner the better.

Links:

Qt framework website: http://qt.nokia.com

Examples of Qt application: http://qt.nokia.com/qt-in-use/target/desktop

MS Office 2011 for Mac gallery: http://www.boygeniusreport.com/gallery/?gallery=23&pid=295

Open source libraries used by Autodesk: http://www.autodesk.com/lgplsource

Disclaimer:
All information included in this post comes from publicly available sources and in best case can be considered as bold speculation. I have no privileged or inside information. All opinions expressed here are my own and not those of my employer or Autodesk Inc.

Project Bluestreak. Dead on arrival?

November 24th, 2009

I should apologize. I went for a dramatic title, to make it sound interesting. If you’re reading this it probably worked. Is Autodesk’s latest project dead on arrival? I certainly hope not, but before I’ll tell you what I think about it let me give you a quick screenshot tour of the project and I’ll show you what to expect if you’re considering giving Project Bluestreak a try.

Let’s start from the beginning. Project Bluestreak was announced last week through the Autodesk Labs blog. As you can see in project’s overview, Autodesk defines Project Bluestreak as:

“Autodesk Project Bluestreak is a web-based collaboration environment for accelerating building information modeling through the open exchange of design information and ideas between desktop applications, web-based services and people.”

When I read that I immediately thought: “Wow! Must be something like Google Wave or Novell Pulse, but with more emphasis on engineering oriented workflow.” Boy, did I set myself up for a disappointment… but I shouldn’t get ahead of myself. Let’s have a look what it’s all about before making any judgement.

The first screenshot shows the home page on which you land after logging in. That page is divided into a few areas. At the top you have a sort of menu bar which appears consistently throughout all pages. Just below that you have some space where you can type a message to “share something with your contacts”. The length of that message is limited to 150 characters. Clearly, this is supposed to mimic a  Twitter or Facebook status. Next to it is the “Messages” window, which doesn’t seem to be used at all at the moment and just below it is a window with all your contacts. The main part of the home page is occupied by the “Activity Stream”. This is simply an area which displays activity notifications from all your contacts and groups that you belong to. Think of it as an equivalent of the Facebook wall.

Bluestreak home page

Next up is the profile page. You can reach it by clicking on any name, including you own if you want to see your profile. It will show you this person’s name, contact details, their contacts (even if they are not your contacts) and finally this person’s activity stream. Again, something pretty close to Facebook profile.

Bluestreak profile page

Now let’s have a look at the groups functionality. Clicking on “My Groups” link from the Groups menu at the top will take you to the page listing all groups that you belong to – ones that you have created and ones that you have joined. There is also a link which allows you to create a new group.

Bluestreak groups page

When you click a group’s name you are transfered to this group’s individual page where you can see some more information about it and perform some tasks related to it. As you would expect after seeing previous pages, you can see the activity stream related to this group and a list of group members. Similarly to your own home page, the group page also allows you to “share information with the group” by means of a short message. This time however this message’s length is limited to 250 characters. A message posted here will show up in the group’s activity stream but not in your personal activity stream, which absolutely makes sense – only members of that group should be able to see what you have posted here. Other members of that group can also comment on your messages. Finally, there’s something new that we haven’t seen on any of previous pages – the “File Sharing” window. This allows users to add files to the group to share them with other members.

Bluestreak group page

If you click the maximize button in the top right corner of “File Sharing” window you will be taken to file sharing page which allows for some basic operations on files (adding and deleting at the moment). Group members can also comment on files, which in a collaborative environment makes a lot of sense.

Bluestreak group files page

Clicking the “Personal Files” link takes takes us to our personal file store. Unfortunately, as you can see in the image below I wasn’t able to add any files to it, but at this stage that’s not something we should be concerned about.

Bluestreak file sharing personal

“Contacts” from the top menu takes you to the contact manager which apart from showing the list of your existing contacts, allows you to invite new users and search existing Bluestreak users.

Bluestreak contacts page

The last element of the top menu is “Applications” and that’s where I think the future of that project lies. Let’s start with the “My Applications”. Here you can see what applications you have “installed” for your account and by clicking the little pencil button you can select for which groups this application should be active.

Bluestreak my applications page

Clicking “Find more applications” link will take you to the last but, in my opinion the most important page of this project. This is where the user can find and “install” applications which will provide additional functionality to the project. First Autodesk need to create some good core applications and then it wouldn’t hurt to open up an API allowing for 3rd party applications.

Bluestreak Find applicatrions page

Finally, if you click the “Feedback” tab on the right edge of you screen, you’ll be able to share you thoughts about the project with the team and other users. If you decide to take Project Bluestreak for a spin I also encourage you to head over here, have a look what other people thought and share your experience. The feedback you provide will certainly help to shape the project and get it as close as possible to your needs.

Bluestreak feedback page

OK, so now it’s time for some comments and my own subjective opinions. At this point I should probably mention that this is my own personal view and opinions expressed here are not those of my employer.

Let’s start with what I think is good about this project. First of all it’s great to see Autodesk trying to do something in this area. I strongly believe that BIM/CAD/CAM/CAE users could use a good collaboration tool closely tied to the software they use all day, every day. Something that could mimic Autodesk’s own, ridiculously overpriced Buzzsaw service – providing the same level of control and confidence in security but also offering some social features that we got used to with Facebook, Twitter, LinkedIn or Plaxo.
The next thing that I find quite positive is that Project Bluestreak is based on open standards and technologies like OpenID and OpenSocial. The only thing that spoils this picture are Flash buttons used in a couple of places (i.e. “Add Files” button in the file sharing application), but that should be relatively easy to get rid of. I’m quite happy to report that all the screenshots have been taken from Google Chrome browser running in Linux. It would be nice if this project marked a general shift for the whole Autodesk towards transparency and open standards.
On the technical side side, I think there is one very cool thing worth mentioning. The fact that you can decide which application is active for which group. This should give the group administrator ability to only provide functionality essential for a given team without causing confusion and distraction by things that will not be useful.

Now, a bit about what I don’t like. The biggest problem I have with this project is the fact that at this point it lacks any industry specific vision and functionality. There are dozens of generic, non-CAD oriented services that offer more functionality and a much more polished experience. Yes, I know, this project has just started and it will only improve but even for an early preview it doesn’t really offer enough to allow you make up your mind about it. It feels like a bunch of random ideas pulled from other social services and put together without a clear vision of how it is supposed to be useful for an engineer or a draftsperson. It certainly is a good framework to build on but it will need much more functionality before users can figure out how to integrate it with their existing work environment.
Next thing that I’m not very keen of is that Project Bluestreak tries too hard to be “social”. First of all I don’t like the fact that all my contacts can see my contact list. In a professional environment, there may be situations where I don’t want everyone to know who I cooperate with. Just like I don’t want everyone in my email address book to know who else is there. It’s not a networking website, like LinkedIn, that can be used for finding interesting “contacts”. It should be a working environment streamlined to make your work easier and life less stressful. On a related note, I’d like to see “Teams” or “Projects” rather than “Groups”. Just a minor wording issue that makes it clear where you are.
One thing that is pretty clear is that Autodesk didn’t make a big commitment to this project. When you look at where Novell has gotten with their Pulse product without even asking users for feedback, you can see that they are building something that is destined to get to the market. There are probably dozens of people working on Novell Pulse for a year or more and when users get their hands on it they will be able to benefit from using it from day one. With Project Bluestreak you get the feeling that it’s the work of just a few people that was slapped together in a few months. Autodesk will probably have no problems shutting the whole thing down if it doesn’t gain enough interest. Well, it will not gain interest if it’s not useful. Remember? “If you build it, he will come.”

So, overall, am I impressed? Well, no… not really. Two years ago – maybe, but not today. Not after using Google Wave since July and seeing Novell Pulse demo at the beginning of November. Not after getting used to how innovative (Inventor Fusion) and visually polished (Project Cooper) Autodesk Labs projects are. In my opinion, if Autodesk wants this project too succeed they need to commit some serious resources to it. Possibly even go back to the drawing board and work out a clear vision of how to integrate all the latest collaboration technologies with their other product. Make the project future proof by embracing new, emerging technologies (like the Wave Federation Protocol) instead of following in footsteps of social projects that have been around for a few years. Finally, Autodesk – be a bit smarter about it. Talk to Novell, talk to Google – they specialize in collaboration tools. Use their experience, buy their expertise if necessary. Spice it up with what you have learned from Buzzsaw and Vault products and you’ll get something useful to every engineer, architect or draftsperson using BIM/CAx software every day.

Links:
Project Bluestreak announcement: http://labs.blogs.com/its_alive_in_the_lab/2009/11/project-bluestreak-now-available.html
Project Bluestreak page at Autdesk Labs: http://labs.autodesk.com/technologies/bluestreak/
Project Bluestreak website: http://bluestreak.autodesk.com/
Project Bluestreak interview with Mark Evans: http://www.youtube.com/watch?v=yJ85_7s_JO4
Googel Wave website: http://wave.google.com/
Google Wave demo: http://www.youtube.com/watch?v=v_UyVmITiYQ
Wave Federation Protocol: http://www.waveprotocol.org/
Novell Pulse press release: http://www.novell.com/news/press/novell-unveils-real-time-collaboration-platform-for-the-enterprise-and-demonstrates-google-wave-interoperability-1/
Novell Pulse website: http://www.novell.com/products/pulse/
Novell Pulse demo: http://www.novell.com/media/media.php?media=novell-pulse
Inventor Fusion at Autodesk Labs: http://labs.autodesk.com/technologies/fusion/
Project Cooper at Autodesk Labs: http://labs.autodesk.com/technologies/cooper/

World’s first F# web browser runs on Linux using Gtk and WebKit

July 11th, 2009

After a long break I finally managed to do some programming for fun. This time I decided to see what WebKit has to offer and at the same time create the world’s first browser written in F#. I whipped it up in a couple of hours and the the whole experience was highly enjoyable, thanks to F#’s succinct syntax and WebKit’s and Gtk#’s easy APIs. In fact it got me so positively wound up that I’ve put shampoo on my toothbrush and then I didn’t remember if I washed my hair already. The only thing missing was MonoDevelop with full F# support, but that I guess, will happen sooner or later. I would also love to see MS finally release F# under Ms-PL so that I could use it for something actually useful. Anyway, here’s a screenshot:

Compiled binary is here, but good luck getting it to run. Source code it here.
If you decide to run it, I would recommend doing that on Ubuntu Karmic (9.10 alfa 2). When I run that on 9.04 it crashes and I think that an older version of WebKit is responsible for that.

Best comic stip ever…

July 9th, 2009

Let’s dedicate it to the anti-Mono crowd…

Wulffmorgenthaler.com

Tasks in Gmail

December 11th, 2008

More fun with Gtk# and Cairo in F#

December 3rd, 2008

This time it has taken me more than I planned but I finally have something to show off.

As usual the compiled exe here and the full code here.

This week I have really struggled to figure out how to mix functional and imperative concpets. After a few days of trying to recursively build an F# list I gave up and resorted to using a ResizeArray<> which is simply an equivalent of C# List<>. I really wonder if a bit more “functional” way of building a list is possible.

Another F# sunday

November 23rd, 2008

So, another weekend, another F# excercise. This time I decided have some fun with Cairo inside Gtk# and a port of the old Knockout example from C# seemed like a prefect idea. Here’s what I got:

Compiled executable here, code here. Now, what I’ve done was pretty much a simple “translation” to get it running but I would love to make the code really functional. So, go headed and comment on what I could change to do it.


Another embarrassing udpate: fixed indentation


Update 2: indentation is broken by WordPress editor. Code replaced with a link.