pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.28k stars 331 forks source link

Keynote manager - BIM 360 #1152

Closed olalancette closed 3 years ago

olalancette commented 3 years ago

Describe the bug While using Keynote manager with a BIM 360 hosted txt file (a converted and non converted version), this error occurs :

keynote 'NoneType' object has no attribute 'Value' Creating keynote manager window

Path to the keynote file is : BIM 360://Hub Name With special characters like é/0000_Project/Project Files/Architecture/0000_Keynotes.txt

If the same txt file is on a local directory, keynote manager works.

To Reproduce

  1. In Revit 2021, open a BIM 360 project.
  2. Annotate Tab, Keynote and set a new txt file on a BIM 360 via Autodesk Desktop Connector
  3. Refresh Keynote
  4. Open pyrevit's Keynote Manager
  5. Error occurs.

Expected behavior Keynote manager opens.

Desktop (please complete the following information):

Autodesk Desktop Connector Version 14.5.0.1144

eirannejad commented 3 years ago

Would you be able to invite me to a test project on this hub so I can test? The hubs that I have don't have special chars

olalancette commented 3 years ago

@eirannejad : You should receive an invitation.

eirannejad commented 3 years ago

@olalancette I'm really sorry I forgot to mention this. Would you mind using this email to invite me ehsan AT mcneel.com I don't have access to bim360 on my personal email. I was never able to get it to work. Thank you!!!

olalancette commented 3 years ago

@eirannejad Done ✅

eirannejad commented 3 years ago

Thanks @olalancette I'm in. So far I'm not seeing any issues. Looking deeper now. Are you using French Revit or just plain English?

olalancette commented 3 years ago

@eirannejad : I'm using French Revit. ("C:\Program Files\Autodesk\Revit 2021\Revit.exe" /language FRA) I've tested with ENU Revit, and I still have the same issue.

eirannejad commented 3 years ago

Would you mind ALT+Click on the Keynote tool. Replace the script.py with this one. This should make Revit show a large crash report with better traceback

script.py.zip

olalancette commented 3 years ago

There is the error :

IronPython Traceback:
Traceback (most recent call last):
 File "C:\pyRevit\main\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Keynotes.pushbutton\script.py", line 1332, in <module>
 File "C:\pyRevit\main\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Keynotes.pushbutton\script.py", line 336, in __init__
 File "C:\pyRevit\main\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Keynotes.pushbutton\script.py", line 584, in _determine_kfile
 File "C:\pyRevit\main\pyrevitlib\pyrevit\interop\adc.py", line 169, in sync_file
 File "C:\pyRevit\main\pyrevitlib\pyrevit\interop\adc.py", line 164, in is_synced
AttributeError: 'NoneType' object has no attribute 'Value'

Script Executor Traceback:
System.MissingMemberException: 'NoneType' object has no attribute 'Value'
 à Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 à IronPython.Compiler.Ast.DynamicGetMemberExpression.GetMemberInstruction.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
 à Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
 à Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 à IronPython.Runtime.Method.MethodBinding.SelfTarget(CallSite site, CodeContext context, Object target)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 à Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2)
 à Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
 à IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite`2.CallTarget(CallSite site, CodeContext context, Object inst, T0 arg0, T1 arg1)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à IronPython.Runtime.Types.PythonType.FastTypeSite`2.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0, T1 arg1)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 à IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 à PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)
eirannejad commented 3 years ago

Great. Now replace pyrevitlib/pyrevit/interop/adc.py with this

adc.py.zip

This should spit out some info into the output window

eirannejad commented 3 years ago

I have a strong hunch I know what the issue is. I'm looking at the file 'Status' property. I think on a Non-English Autodesk Desktop Connector, this actually has a different name :/

olalancette commented 3 years ago

Seems to be the same error (without more info from output) :

IronPython Traceback:
Traceback (most recent call last):
 File "C:\pyRevit\main\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Keynotes.pushbutton\script.py", line 1332, in <module>
 File "C:\pyRevit\main\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Keynotes.pushbutton\script.py", line 336, in __init__
 File "C:\pyRevit\main\extensions\pyRevitTools.extension\pyRevit.tab\Drawing Set.panel\Keynotes.pushbutton\script.py", line 584, in _determine_kfile
 File "C:\pyRevit\main\pyrevitlib\pyrevit\interop\adc.py", line 177, in sync_file
 File "C:\pyRevit\main\pyrevitlib\pyrevit\interop\adc.py", line 172, in is_synced
AttributeError: 'NoneType' object has no attribute 'Value'

Script Executor Traceback:
System.MissingMemberException: 'NoneType' object has no attribute 'Value'
 à Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 à IronPython.Compiler.Ast.DynamicGetMemberExpression.GetMemberInstruction.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
 à Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
 à Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 à IronPython.Runtime.Method.MethodBinding.SelfTarget(CallSite site, CodeContext context, Object target)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
 à Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2)
 à Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
 à IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite`2.CallTarget(CallSite site, CodeContext context, Object inst, T0 arg0, T1 arg1)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à IronPython.Runtime.Types.PythonType.FastTypeSite`2.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0, T1 arg1)
 à System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 à Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
 à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
 à IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
 à PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)
eirannejad commented 3 years ago

Yeah but did you get an output window as well with some info?

eirannejad commented 3 years ago

When you browse into the BIM360 drive in your windows explorer, are the list headers in English? Trying to see if ADC is using a French translation for "Status". I changed my ADC to French and the actual "Synced" value is in French now

Screen Shot 2021-02-05 at 11 11 17 AM

olalancette commented 3 years ago

Here is the translation: "État" image

olalancette commented 3 years ago

Yeah but did you get an output window as well with some info?

No output window. Only the error.

eirannejad commented 3 years ago

Ok. Found the bug. It's Status and Synced strings being in French. Let me work on a fix. Thanks a lot for reporting this!

eirannejad commented 3 years ago

Ok. Replace the keynote manager script and the adc with these two. This should fix the issue

Archive.zip

olalancette commented 3 years ago

Hurray 🎊

Thanks a lot !

xepo6oez commented 2 years ago

Hi, I have same issue, use Enq Version, changed script.by and adc but it doesn't help.

Keynote Manager

@eirannejad could you advice please how can I solve this issue?

PyRevit v4.8.8 OS Windows 10 Enterprise (20H2)

Couldn't open pyrevit env command, pyrevit env

olalancette commented 2 years ago

@xepo6oez Should be resolved with pyrevit 4.8.9 or higher. See issue #1371 (PR #1398)