Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Using "Load Families" tool #2446

Open
5 tasks done
TimingBasket opened this issue Nov 1, 2024 · 3 comments
Open
5 tasks done

[Bug]: Using "Load Families" tool #2446

TimingBasket opened this issue Nov 1, 2024 · 3 comments
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]

Comments

@TimingBasket
Copy link

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

I am attempting to use the "Load Families" pyRevit add-in for Revit 2022. The families are located on onedrive and to use the tool I am using keyboard shortcut "AFF."

The answer to this question does not seem to have been asked or answered in the forum or issues from what I can tell.

⌨ Error/Debug Message

IronPython Traceback:
Traceback (most recent call last):
File "C:\Users\username\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\ptools.stack\Family.pulldown\Load Families.pushbutton\script.py", line 26, in <module>
File "C:\Users\username\AppData\Roaming\pyRevit-Master\site-packages\pathlib.py", line 613, in _from_parts
File "C:\Users\username\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Project.panel\ptools.stack\Family.pulldown\Load Families.pushbutton\lib\file_utils.py", line 52, in search
File "C:\Users\username\AppData\Roaming\pyRevit-Master\site-packages\pathlib.py", line 936, in __new__
File "C:\Users\username\AppData\Roaming\pyRevit-Master\site-packages\pathlib.py", line 606, in _parse_args
File "C:\Users\username\AppData\Roaming\pyRevit-Master\site-packages\pathlib.py", line 75, in parse_parts
File "C:\Users\username\AppData\Roaming\pyRevit-Master\site-packages\pathlib.py", line 57, in _py2_fsencode
UnicodeEncodeError: ('unknown', u'\u2013', 41, 42, 'Unable to translate Unicode character \\u2013 at index 41 to specified code page.')


Script Executor Traceback:
System.Text.EncoderFallbackException: Unable to translate Unicode character \u2013 at index 41 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at IronPython.Runtime.PythonAsciiEncoding.GetByteCount(Char[] chars, Int32 index, Int32 count)
at System.Text.Encoding.GetBytes(String s)
at IronPython.Runtime.Operations.StringOps.DoEncode(CodeContext context, String s, String errors, String encoding, Encoding e)
at IronPython.Runtime.Operations.StringOps.RawEncode(CodeContext context, String s, Object encodingType, String errors)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run6[T0,T1,T2,T3,T4,T5,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
at Microsoft.Scripting.Interpreter.DynamicInstruction`6.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at IronPython.Runtime.Types.PythonType.NewSite`1.Call(CodeContext context, Object typeOrInstance, T0 arg0)
at IronPython.Runtime.Types.PythonType.FastTypeSite`1.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronPython.Runtime.Method.MethodBinding`1.SelfTarget(CallSite site, CodeContext context, Object target, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

♻️ To Reproduce

1.) Revit ribbon → 2.) pyRevit → 3.) Project → 4.) Family → 5.) Load Families → 6.) Select folder containing families (.rfa) → 7.) Error window popup

Steps 2, 3, & 4: image

Step 6: image

Step 7: image

⏲️ Expected behavior

1.) Revit ribbon → 2.) pyRevit → 3.) Project → 4.) Family → 5.) Load Families → 6.) Select folder containing families (.rfa) → 7.) Family Selection Window

Steps 2, 3, & 4: image

Step 6: image

Step 7: image

🖥️ Hardware and Software Setup (please complete the following information)

C:\Users\username>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.16.24121+2117" | Path: "C:\Users\username\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "23.1.2" | Engine: DEFAULT (2711) | Path: "C:\Users\username\AppData\Roaming\pyRevit-Master"
master | Product: "Autodesk Revit 2022" | Engine: DEFAULT (2711) | Path: "C:\Users\username\AppData\Roaming\pyRevit-Master"
master | Product: "2021.1.8" | Engine: DEFAULT (2711) | Path: "C:\Users\username\AppData\Roaming\pyRevit-Master"
master | Product: "2020.1 (Full Install)" | Engine: DEFAULT (2711) | Path: "C:\Users\username\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
==> Default Extension Search Path
C:\Users\username\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
23.1.2 | Version: 23.1.20.70 | Build: 20230510_1100(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023"
Autodesk Revit 2022 | Version: 22.1.70.9 | Build: 20240704_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
2021.1.8 | Version: 21.1.80.35 | Build: 20230515_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
2020.1 (Full Install) | Version: 20.1.1.1 | Build: 20190731_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.
Run with "--debug" option to see debug messages

Additional context

No response

@TimingBasket TimingBasket added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Nov 1, 2024
@sanzoghenzo
Copy link
Contributor

sanzoghenzo commented Nov 1, 2024

Hi @TimingBasket , python 2 has troubles with utf8 chatacters in the paths.
I your case, the code \u2013 refers to the EM dash char.
If you can, use normal dashes in your file names

@TimingBasket
Copy link
Author

Thank you @sanzoghenzo , it seems there is only on EM dash char. in the file path but it is on my workplaces sharepoint. If I change the name replacing the problem char. will that affect anyone else or just be reflected on my workstation?

@jmcouffin
Copy link
Contributor

Thank you @sanzoghenzo , it seems there is only on EM dash char. in the file path but it is on my workplaces sharepoint. If I change the name replacing the problem char. will that affect anyone else or just be reflected on my workstation?

There is a good chance it will affect everyone @TimingBasket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]
Projects
None yet
Development

No branches or pull requests

3 participants