architecture-building-systems / revitpythonshell

An IronPython scripting environment for Autodesk Revit and Vasari
MIT License
502 stars 116 forks source link

Python Shell stop working #87

Closed harrucci closed 5 years ago

harrucci commented 6 years ago

Hello everyone,

I am using Revit 2017 with the corresponding pythonshell edition. Up to now, everything worked fine. But suddenly it doesn't recognize the very basic functions:

Exception : IronPython.Runtime.UnboundNameException: name 'BuiltInCategory' is not defined

I tried the code on another computer with the same Revit and Python editions and every works fine. So, the problem is not with the code itself. What it could be?

For your information the computer is inside a company network and Revit takes its licence vie a Revit Server.

daren-thomas commented 6 years ago

Could you please provide a bit more information? What are the exact steps you take to get to the exception you mentioned above? Is that the only information you recieve?

What do you mean with "very basic functions"? Is that a button you're trying to press? Or do you mean Revit API?

oguztuncay commented 5 years ago

i have the same problem. it doesn't seem to recognize the 'BuiltInCategory' from Revit's database.

daren-thomas commented 5 years ago

@oguztuncay could you maybe provide a set of steps to reproduce the error?

oguztuncay commented 5 years ago

hi daren, it was an amateur mistake. now it's gone. thank you for getting back so quickly. i'm sure i'll have more interesting problems for you in the future:D

eirannejad commented 5 years ago

@oguztuncay This was probably a bug in the init script right?

oguztuncay commented 5 years ago

i don't think so. it was a typo that i made when I was trying to import BuiltInCategory. But now I can't execute 'LookupParamater' for a wall object. It says it's not one of the attributes.

eirannejad commented 5 years ago

Share your scripts please.

CyrilWaechter commented 5 years ago

There is a typo in 'LookupParamater' => LookupParameter

oguztuncay commented 5 years ago

no there is a typo in my comment not in the script give me a sec

oguztuncay commented 5 years ago

capture

CyrilWaechter commented 5 years ago

selection return a list of element. Use selection[0] to call LookupParameter on first element.

selection[0].LookupParameter("parameter_name")
oguztuncay commented 5 years ago

yes! thanks a lot!