Add .dll reference to get the Intellisense


#5

Yes i understand this, i was just wondering how user friendly it is, and whether it would be better to get a full understanding of python before using vs or something similar like pycharm?

Ok thanks, i’ll give it a whirl.


#6

In my opinion Visual Studio is too comprehensive if you only need to ‘code’ some python scripts, thats why I am looking for a lightweight IDE like Visual Studio Code. I dont need anything else than a simple editor but I would prefer to have intillisense… and I have not figured how this could be implemented for IronPython 2.7.3, Revit API, Dynamo API and DesignScript in VSC yet.


#7

Did you take a look at pycharm ? It’s way lighter than VisualStudio. Could be a good fit for what you’re trying to do !


#8

@Sylvester_Knudsen1 never managed to. I did some quick research and it seems to be possible but it’s definitely not as simple as it should be …


#9

@Gui_Talarico has worked out a solution here: https://github.com/gtalarico/ironpython-stubs


Python autocomplete?
#10

Seems to work fine with VS Code as well.


Python autocomplete?
Splitting topics and locking is poorly administered
#11

Thanks for the hints, but I will have to wait until someone makes the complete step by step guide from scratch… I simply have to give up. I cant find the coherency or meaning in all those different links I am being directed in.
Using hours on this and still nothing works, is so much waste of time.

Why it isnt easy to do is a mystery to me. Installing a lightweight environment should be so easy that we “spare time coders” should be able to get it going easily.
That is clearly not the case, and that is really making the range of action smaller for many not just me.


#12

@Mostafa_El_Ayoubi agreed. I tried and couldn’t get it to read the RevitAPI or RevitAPIUI dll’s.

I then found this comment by Giulio Piacentino on the Rhino forum about using PyCharm to load the RhinoCommon dll and its not possible. I came to the conclusion that the Revit API may be affected by the same problem cc @Sylvester_Knudsen1

Using Visual Studio is also limited as the references to the libraries need to use full paths (as far as I’m aware) which are not necessary when running the code in Dynamo. Seems like there’s a clear winner here… @Gui_Talarico solution


#13

If you’re curious about Dynamo’s current IDE, it is based on an older version of Avalon Edit. You can find the current autocomplete implementation here:


#14

thanks @Dimitar_Venkov, but by now have I figured that it is out of my league to get this going… I have to do dumb lookup and code by reading the python webpage and the Revit API page. God should know that I would wish it was differently, but I simply don’t have the needed skills to understand how to set up the IDE environment in VSCode or anywhere else. I am wasting to much very valuable time in trying.

I have lost this battle, thats is how it is :-S


#15

@erfajo if using Atom is an option then you can follow @Gui_Talarico’s step by step directions here.


#16

@Mostapha
That is the link @Konrad_K_Sobon revealed and @Gui_Talarico followed up upon… and I answered. So instead of running in circles, let me recap… it still doesnt work for me :-S


#17

Thank you for the folow up @Thomas_Mahon!
kinda sucks you cant do that in pycharm…

I’ve been trying to get this working i Visual Studio, but i can only get Dynamo libraries to work, when using the “search Paths” and specifing the “C:\Program Files\Dynamo\Dynamo Core\1.3” folder it works perfectly.

But when i try the same with Revit libraries using the “C:\Program Files\Autodesk\Revit 2017” folder, it fails!
maybe this is more complicated then i hope, but do you know why this is?


#18

Probably because Revit API libraries are MUCH bigger in size and it simply runs out of allocated memory. I know the same thing happens with pyCharm when you try to load RevitAPI.


#19

@Sylvester_Knudsen1 thats as far as I got; I don’t use IDE’s with Python only C# to be honest. However, I have looked into this (finding an IDE for IronPython) before as a means of supporting some new Python users I work with, but the arduous problems I encountered when attempting to load the RevitAPI put the whole thing to bed and I haven’t tried since. It’s why we didn’t use one in the Python workshop a few week’s ago; it opens up a can of worms and is half-baked at best!

If anything, I would recommend using Sublime for the time being, and stick with VS for viewing the RevitAPI/UI and Dynamo libraries as I taught - its about as good as it gets until someone can find a solution.

@Konrad_K_Sobon that’s interesting. Is this verified anywhere? It would be good to get some input from the Dynamo developers on this? I’m surprised by how chronic this problem is and the hindrance it causes. …glad to see I wasn’t alone with the frustration it causes at least.


#20

I think it will be more helpful if you provide more details and tell us at which step do you have an issue? :slight_smile:


#21

This feels like it may partially be due to the hindrance of an open source program (Dynamo) being hindered due to the reliance on a close source (Revit) software @Konrad_K_Sobon spoke of on his blog awhile back…


#22

We are talking about Revit API libraries so Dynamo developers can’t do anything about this. Also, there is nothing wrong with a DLL containing a lot of stuff, so I am not sure i would want to bother anyone with this anyways.

The “running out of memory” is not a problem with the DLL, but with pyCharm or Atom. Each of these IDEs has a number allocated for how much stuff it keeps in memory when dealing with AutoComplete. @Gui_Talarico hints at that in his instructions on how to get his solution installed. pyCharm does the same thing. By default it’s set to 2GB and that is not nearly enough to get RevitAPI and RevitAPIUI stubs loaded and good to go. Problem is that even with that number cranked to 10GB it will not handle the whole thing, and that goes back again to what @Gui_Talarico hinted at with Jedi just being a massing resource hog. He also suggested that instead of trying to crawl the whole library we should perhaps use truncated stubs and save our computer resources.

@Thomas_Mahon yes, it’s verified. I am running auto completion in pyCharm for RevitAPI, Revit APIUI and all other Dynamo libraries. It uses the same method that @Gui_Talarico posted - generator3 to create stubs, then load them into pyCharm - but since it’s a little finicky I wasn’t planning on posting it until i figure out a sure fire way to make it work every time. Also, I am on a pyCharm pro, and haven’t gotten it to work on the free version yet, so that’s part of the issue as well. I need to figure out if there is a correlation between that.


#23

@Mostafa_El_Ayoubi, no not yet. @Kulkul has suggested “Sublime Text” and that looks also interesting.

I had an idea that since it is a MS$ tool and in the VS range, I would imagine that I could transfer things and knowledge between the VS and VSC platform, but that doesnt unfortunately seem to be the case.


#24

@Mostafa_El_Ayoubi - do you know if it’s possible to reference something like the Revit API.dll in a pycharm project, so you can get code completion features?