DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.74k stars 634 forks source link

Python Script node: wrong line count in traceback #338

Closed andydandy74 closed 11 years ago

andydandy74 commented 11 years ago

This is really just a minor nuisance when debugging Python code in the Python script node, but still: bildschirmfoto 2013-08-05 um 17 17 31 bildschirmfoto 2013-08-05 um 17 17 52 The line count is off by 11 lines. My current solution is a post-it next to my screen ("-11 LINES"), but if it's easy to fix, please do. ;-)

pboyer commented 11 years ago

Hey there,

Previously, we inserted some import statements in front of the script at run time. Now, we make this completely explicit, also fixing this issue. Note, that this will break previous python scripts, so you'll have to fix old scripts by adding the following to the top:

import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
import Autodesk