Python Autocomplete doesn't work for variables?

Hi all

I’m learning to instantiate GH Components on the fly. I’ve been following James Ramsden’s Tutorials, and porting them to C#, and a few examples from the forum - here, here and here.

My question is, I haven’t been able to find a python documentation for a few classes and methods (specifically the ghenv.Component. Also, the AutoComplete doesn’t show up when I’m working on variables. Is there a workaround for this? Is it possible to use some external editor - where AutoComplete functions better?

(AutoComplete works fine in the C# editor though, So I’m just referring the methods there and porting to Python)

EDIT 1: I also tried using
Atom Text Editor on Mac - NoLuck
PyCharm CE on Mac - Partial Luck (Better than the Rhino(Windows) default editor)

~ ~ ~ ~ ~ ~ ~ ~
Kaushik LS
Chennai, IN

We’re working on improving auto complete. For now, although tedious, you could pass the object to the dir() function, filter, and print the results to a panel.

Hi Alain,

No Problem, and no hurries. I was just wondering how people generally get exposed to new methods, and classes while learning. I guess the dir() method is one of the (easier) ways, than to guess half-blindly from C# scripts.

Thank you for your reply. Have a great day! :smiley:

~ ~ ~ ~ ~ ~ ~ ~
Kaushik LS
Chennai, IN

Hi, what I often use in these cases is LocalScope.

ghenv.LocalScope.myPanel.

The autocomplete should kick in from there.
As far as I understand it, the LocalScope holds all the names currently defined inside the scope of your ghPython component. You have to run the script at least once after defining new variable for it to be recognized.

2 Likes

Wow, this is cool. Thanks for the tip!