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

RPS not loading in Revit 2025 #159

Open
hisdirt opened this issue Sep 16, 2024 · 8 comments
Open

RPS not loading in Revit 2025 #159

hisdirt opened this issue Sep 16, 2024 · 8 comments
Assignees

Comments

@hisdirt
Copy link

hisdirt commented Sep 16, 2024

Describe the bug
The upgrade process to newer Revit Versions doesnt work in Revit 2025. When addin manifest is copied into the Revit 2025 folder (and paths updated etc), an error is thrown on Revit startup

To Reproduce
Steps to reproduce the behavior:

  1. Copy over addin files to Revit 2025 folders
  2. Run Revit 2025
  3. See error

Expected behavior
Expected to see the RevitPythonShell addin on the Ribbon

Screenshots
Screenshot 2024-09-17 091352

Desktop (please complete the following information):

  • OS: Windows 10, 11

Additional context
It seems that pyRevit is having similar issues, seems to be related to Revit 2025 upgrading to .net CORE 8.0

@Ianhuuuuang
Copy link

Ianhuuuuang commented Sep 16, 2024 via email

@daren-thomas
Copy link
Member

Ah. This is going to be a tricky one I think - Revit really jumped from .NET Framework 4.8 to .NET 8. That's... quite a leap.

This will probably also affect scripts a bit, so this blog post might help migrating those: https://thebuildingcoder.typepad.com/blog/2024/04/migrating-from-net-48-to-net-core-8.html

As for RPS itself, I'll need to come up with a new strategy of creating the assembly. This could take some time as I have to do this in my free time.

Any help is appreciated.

@daren-thomas daren-thomas self-assigned this Sep 17, 2024
@daren-thomas
Copy link
Member

@daren-thomas
Copy link
Member

Reproduced the issue no problem (just copy contents of Roaming\Autodesk\Revit\Addins\2024 to Roaming\Autodesk\Revit\Addins\2025, specifically the RevitPythonShell.addin file and the RevitPythonShell folder).

Hit a snag: Is it just me or does JetBrains Rider have a hard time opening the solution? If I remember correctly, we might have done some funky things with the project configurations. I'll look into that next, else try with Visual Studio (Community Edition? Or what is that called?)

@daren-thomas
Copy link
Member

Good news and bad news so far...

Good news: I've been able to rewrite the assembly generation logic using Roslyn (the StackOverflow question above didn't pan out sadly) and I actually like the new version much better.

Bad news: Now I'm having problems with the IronPythonConsole we use. This is code I was always hoping never to have to touch again. The current error goes a bit like this:

System.NotSupportedException
Specified method is not supported.


System.AggregateException
System.NotSupportedException: Built-in COM has been disabled via a feature switch. See https://aka.ms/dotnet-illink/com for more information.
   at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags)
   at MS.Win32.UnsafeNativeMethods.RegisterDragDrop(HandleRef hwnd, IOleDropTarget target)
   at System.Windows.DragDrop.RegisterDropTarget(IntPtr windowHandle)
   at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)
   at Microsoft.VisualStudio.XSurface.Wpf.DesignerSurface.CreateSource()
   at Microsoft.VisualStudio.XSurface.Wpf.DesignerSurface..ctor(IProtocolHandler protocolHandler, TapDocument document)
   at Microsoft.VisualStudio.XSurface.Wpf.Tap.SurfaceService.HandleCreateSurfaceInternal(CreateSurfaceRequestInfo requestInfo)
   at Microsoft.VisualStudio.DesignTools.RuntimeHost.TapOM.ResponseWithError.ThrowIfFailed()
   at Microsoft.VisualStudio.DesignTools.SurfaceDesigner.Documents.SurfaceIsolation.DesignerInstanceManager.<BuildDocumentAsync>d__57.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.DesignTools.XamlSurfaceDesigner.Views.IsolatedSurfaceImageHost.<CreateSurfaceAsync>d__67.MoveNext()

System.AggregateException
One or more errors occurred.

I've tried enabling COM explicitly, but it's not working and I'm tired and it's Sunday so I'm just going to stop for today.

@daren-thomas
Copy link
Member

OK. So. This branch shows how to fix the error mentioned in the issue, but it's not a replacement or upgrade of RPS to .NET 8. That seems to require a re-implementation of the console part. If anyone is interested in doing that, go ahead. I've decided I don't want to do this myself.

@sashtet
Copy link

sashtet commented Jan 14, 2025

Good day and thank you for your work!
Tell me when there will be a new release RevitPythonShell and what version of IronPython is planned for the future?

@Ianhuuuuang
Copy link

Ianhuuuuang commented Jan 14, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants