Thoughts on using Visual Studio

Hi,

I’m currently writing a few routines in Python using Dynamo - all seems to be going well.

I’ve been looking at Visual Studio, as I like the idea of writing a add in application which I can distribute.

I see that Microsoft do a Python plugin for VS, can anyone give any advise on moving to Python for Revit in Visual Studio - I assume its possible?

Thanks.

Visual Studio is extremely robust and it can definitely handle python, but depending on your use case it may not work as intended until you run the script in dynamo. There is a toolset to download and turn on in VS that you can find from the visual studio website

Personally I don’t use VS, I downloaded an IDE from the python website and have been using it ever since.

1 Like

You could choose any IDE, I don’t think it would really matter.

1 Like

Can you achieve the same things in Python in Visual Studio (or another IDE) as you can with C#.

I’d like to create a stand alone Revit toolbar which I would like to distribute around my company - i…e create an addin and DLL.

I know this can be odne with C#, can the same be done with Python (I see that Python is interpreted rather than compiled - maybe that would be an issue?)

Thanks.

1 Like

You should look into PyRevit

2 Likes

You can do that with Python, please have a look at Revit Python Shell and great examples that Darren posted on his blog. Here’s an example of that: https://daren-thomas.gitbooks.io/scripting-autodesk-revit-with-revitpythonshell/content/more_control_over_the_ribbonpanel.html

2 Likes

Bringing this topic back to life after two years…

I find myself in the same position as Kevin: I’ve been doing some Dynamo+Python scripts for my company for a while and now it’s time to turn some tools into an addin.
I know the basics of Python, but most of the examples I’ve seen of Revit Addins are made with C# on Visual Studio.

Considering this, is there any big difference/advantage in the use of any specific language to write addins to Revit or it is just a matter of taste?

Thanks

api document is written in C#, C++ and Visual Basic. C# is clearly my go-to language. I don’t think it really matters which language you use. But if you choose python, you need to know how to code the equivalent thing of C# in python. Like how to implement an interface in python. My company is very obsessed with Dynamo, so I usually send them .dyn contains python script. But when I work with my own task or test something, C# is difinitely my first choice.

1 Like

I personally prefer C# for writing plugins, but I started with C# and revit API, so it feels more natural for me. Python came second when using Dynamo and I think python is an easier language to learn so it was quite simple to pick up coming from a stricter language. I wouldn’t say either is better or worse, they both are very strong languages and widely used. However, for plugins and the Revit API, you’ll find way more resources written in C# and therefore speed up your progress, I think this is quite an important point and what in my opinion you should most consider.

1 Like

Just posting this to anybody who would like to transition from python to C# (youtube will automatically play other similar videos hopefully)
2 Likes