Giter Club home page Giter Club logo

rhino.inside's Introduction

Rhino.Inside®

Discourse users

The Rhino.Inside® technology allows Rhino and Grasshopper to be embedded within other products. It may be possible to:

  • Starting Rhino and Grasshopper as an add in another product.
  • Call directly into the host's native APIs from a Grasshopper or Rhino plugin.
  • Access Rhino's APIs through the host application.
  • Grasshopper definitions can be opened and previewed in Rhino within the same process as the parent.
  • Object can be natively created by Rhino or Grasshopper within the parent product.

Samples by host application.

🚧 Samples are moving to https://github.com/mcneel/rhino-developer-samples/tree/7/rhino.inside 🚧

This is a list of projects or examples which make use of Rhino.Inside:

If you have any questions, visit the discussion forum...

rhino.inside's People

Contributors

anddoyoueverfeel avatar dalefugier avatar davidandresleon avatar davidrutten avatar fraguada avatar golsby avatar kike-garbo avatar kyeshmz avatar mingbopeng avatar mostapharoudsari avatar pearswj avatar sbaer avatar scotttd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rhino.inside's Issues

Sample2 CallUnity.gh cannot be opened

Hi,

I am trying to open callUnity.gh example from your repository while running Unity or without.
But it cannot be done I get read/write error and "I have no idea what to do":

Can someone upload the grasshopper file again?

q

DotNet example

Rhino.RhinoDoc.Open(ofd.FileName, out bool alreadyOpen);
alreadyOpen: Status is always false

Is it possible to use RhinoInside to compile ghpy components?

This tutorial is of great help to create a distributable ghpy file for a bunch of python components, however, the compilation step needs to happen manually. We would love to be able to automate it.
Is it possible somehow to run this compilation step from the command line, perhaps with RhinoInside, or some other trick?

Thanks!

ViewportControl and floating window

I am experimenting RhinoInside with the WinFormsApp example.

The RhinoWindows.Forms.Controls.ViewportControl behaves unexpectedly.

It opens floating windows saved in the file.
Being able to have floating windows is good enough, but it uses the inputs entry as Rhino.
We can select an object with a left click and translation comes with ctrl/right click.

image

Rhino Inside AutoCAD: Creating headless document causes inconsistent state and fatal error/crash

We need to set the units of the Rhino inside document in our AutoCAD application. Using the following for debug builds works fine:

var style = WindowStyle.Normal;

_rhinoCore ??= new RhinoCore(new[] { $"/scheme={schemeName}" }), style);

var rhinoDoc = RhinoDoc.ActiveDoc;
rhinoDoc.ModelUnitSystem = this.GetRhinoUnitSystem(internalUnits);

However, for release builds we don't need the UI, so a headless version is required. However:

  1. It doesn't create a document,
  2. It's therefore not possible to set the units, and
  3. What document exactly are we using?
  4. If we create a headless document, the application becomes unstable and inadvertently crashes AutoCAD without warning. No breakpoints hit either, its fatal.
var style = WindowStyle.NoWindow;
_rhinoCore ??= new RhinoCore(new[] { $"/scheme={schemeName}" }), style);

var rhinoDoc = RhinoDoc.CreateHeadless("...a mm template file");
rhinoDoc.ModelUnitSystem = this.GetRhinoUnitSystem(internalUnits);

We've checked the validity of the RhinoDoc.ActiveDoc straight after creating the headless doc and its valid and its units are successfully set. var style = WindowStyle.Hidden has also been tested and it seems to be stable, however it always displays the splash screen which we don't want. Rhino.UI.Dialogs.KillSplash() doesn't seem to work.

What is the correct procedure?

RhinoCore.Dispose()

Hello,

Could someone provide more explanation on what is happening when this method is called?

I want to clear somethings up, based on the behaviour I am getting.

1> Initialize a new instance of RhinoCore
2> Rhino's interface opens up (If the WindowStyle chosen is Normal)
3> RhinoCommon code could be run here
4> Call Dispose on the class instance
5> Rhino's interface is closed
6> RhinoCommon code could still be run

Questions

A. Is there a way to start Rhino's interface again, without initializing a new instance of RhinoCore?
When I do that Rhino opens on the Licensing window asking for a license, then when I deal with that, it starts loading but throws errors in couple of plugins
" Error occurred loading plug-in. Details: Exception has been thrown by the target of an invocation ---- mscorlib"
" Unable to load rdk_ui.rhp plug-in: application initialization failed"
" Unable to load Displacement.rhp plug-in: could not open plugin file or plug-in failed to start"
Then the program I am trying to run Rhino inside crashes.

B. Could you explain why after step number 4, step number 6 is still possible?

DLL HELL - Can not load RiR. No conflicting dlls, but apparently...I have conflicting DLLS

I cant run RiR.

I've:

  1. Removed all external addins.
  2. Uninstalled and reinstalled Rhino 7.
  3. Uninstalled RiR 1.0, 1.2, 1.3, 1.6.
  4. Searched my entire C drive for the RiR dlls. They only exist in one location.
  5. Checked all the locations where Revit addins are installed.
  6. Tested in R2020 and R2022.

After all of this...
image

This is now business critical - my company is developing software for a private client and we have a deliverable deadline every week. While RiR fails to load we cant do anything which causes us to miss our deadlines and damages our business, not to mention how much time it wastes while we try and find the cause. Can someone from McNeal escalate this issue and can technical support contact me via video link so we can find an immediate fix? @kike-garbo @sbaer

Rhino.Inside.CEF, missing RhinoLibrary.dll

Hello,

I wanted to test the javascript sample 5 and I have this exception from HRESULT : 0x8007007E missing RhinoLibrary.dll, which is present in the 'C:\Program Files\Rhino 7 WIP\System' directory

What I did so far with the original project, is that I updated the references to rhinocommon, grasshopper and GH_IO, I replaced the 3 'Rhino WIP" occurences in RhinoTaskManager.cs with "Rhino 7 WIP", what did I miss?

rhinoLibraryDllBug

New implementation for TopSolid

We want to create an implementation for TopSolid

How can we get help or submit questions !?

What we have already tried

  1. Plugin creation for TopSolid : RhinoInsideTopSolid.AddIn
  2. Add Nuget Package Rhino.Inside version 0.2.0
  3. To try to correct the loading problem : Copy RhinoCommon.dll in TopSolid application
  4. As soon as TopSolid start, the DLLs cannot be initialized with the command RhinoInside.Resolver.Initialize();

However I cannot load Rhino DLLs.

error-load-topsolid

revit 2019 and revit 2018 lost responding when creating or modifing

revit 2019 and revit 2018 lost responding when creating or modifing.
I leaved rinnoinside plugin only, and test it on three computer(win11). And it stucked everytime, Once I created duct sinstance after clicked the rhino start button. Before click the start button, everything worked

Rhino inside CATIA?

A Rhino inside CATIA would leverage CATIA's industrial level of precision & performance while keeping the ease of use from Rhino & GH. Meanwhile, Grasshopper definitions share some what similarity to CATIA Power Copy/ Knowledge Patterns, also Dassault has started their own graphic programming interface.

Any chance to add Rhino Inside CATIA to your agenda?

Host application resolves assemblies in its own AppDomain

I'm running into situations where a host application chooses to resolve and load assemblies in its own AppDomain (creates a specific AppDomain). The Host application might chose to do this in order to support Shadow Copying, for example.
The issue this causes is mainly experienced when using the Grasshopper api via Grasshopper.dll. In this situation, if the Grasshopper plugin is loaded via the PlugIn.LoadPlugIn(GrasshopperGuid), subsequent calls to the Grasshopper namespace are calling a Grasshopper.dll loaded in a different AppDomain than that where Rhino has loaded Grasshopper.dll. This means that one cannot actually call any of the Grasshopper API.
What would be the solution for this case?
Is this something that would need to be changed in the Rhino source code, or is this something that can be handled by the code referenced to in this issue: #196?

Relaunch Rhino app if closed when attached to AutoCAD

Is it possible to relaunch the Rhino app when launched inside AutoCAD.

Example:
Rhino launches when AutoCAD starts (which is great for debugging purposes).
I close Rhino application after its launched.

How can I re-open it?

If I launch Rhino via its short cut icon its not 'attached'. So maybe a better question to ask, is how can I re-open the attached version. I don't mind if this has a programmatic solution since the end user is not interacting with Rhino, we just need it open for software development purposes.

Following Unity setup as instructed fails to find rhino library dll

Not sure if there's something wrong with my setup or not, thought I'd raise it just in case it's occuring fo multiple users.

  1. Installed latest Rhino WIP ,
  2. Installed Unity 2018.3.0f2 Personal,
  3. Ran .bat file in the project before opening project, successfully moved RhinoCommon into the folder
  4. Opened project using the Unity Hub

Getting the following error:
System.DllNotFoundException: RhinoLibrary at (wrapper managed-to-native) Rhino.Runtime.InProcess.RhinoCore.Startup(int,string[],Rhino.Runtime.InProcess.RhinoCore/StartupInfo&,intptr) at Rhino.Runtime.InProcess.RhinoCore..ctor (System.String[] args, Rhino.Runtime.InProcess.WindowStyle windowStyle, System.IntPtr hostWnd) [0x0011b] in <994a089de5654759821e86b47bc9444f>:0 at Rhino.Runtime.InProcess.RhinoCore..ctor (System.String[] args, Rhino.Runtime.InProcess.WindowStyle windowStyle) [0x00000] in <994a089de5654759821e86b47bc9444f>:0 at RhinoInside.Unity.Startup..cctor () [0x00068] in C:\Users\Chris\Repos\Rhino Inside\Unity\Sample1\Assets\Standard Assets\RhinoInside\Unity.cs:25 UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

Creating Rhino Viewport in AutoCAD pligin only works if the application is Hidden - undesirable

@kike-garbo

We need to add a Rhino viewport to our WPF application in AutoCAD. Its easy enough, however there is one issue:

  • Rhino has to be launched at best, using WindowStyle.Hidden, as I assume the UI in Rhino must be loaded to use UI components.

While this isn't the end of the world, it causes two problems:

  1. Slower start-up times.
  2. The Rhino splash screen displays which we don't want to see.

We've found Rhino.UI.Dialogs.KillSplash() but this kicks in after a few seconds, meaning the splash screen still displays. We do not want the splash screen visible at all - similar to Rhino Inside Revit. And before you ask, we've used the same viewport control in Revit add-ins and it works just fine, so there must be a way of achieving the same result using Rhino in AutoCAD. Can you help?

Move samples and docs

Move the samples and documentation in this repository to the McNeel developer samples repo: https://github.com/mcneel/rhino-developer-samples
Keep this repository for building the Resolver package.

UPDATE
dotnet and JavaScript samples moved. Next step is to test and move other samples, remove the samples from here, and add relevant links

  • Start moving samples (dotnet and JavaScript)
  • Test and move other samples (AutoCAD, Illustrator, Unity, Unreal, etc)
  • Remove Samples
  • Add links to developer samples repo

Licence question Rhino Inside AutoCAD

How are license's allocated using Rhino Inside AutoCAD? In the boilerplate provided in this repo I'm assuming licence allocation occurs when the Rhino core is initialized?

m_rhino_core = new RhinoCore(new[] { $"/scheme={schemeName}" }, style);

BricsCAD

Hi I wanted to test Inside.Rhino with BricsCad.
I got stuck with RhinoInside.BricsCAD.sln
If I want to open with Visual Studio 2017 I got an error
image

The selected File is not a valid solution file

can anybody help?

Inaccessible 'Rhino 5 Plugins may require updates' popup causes Unity to hang.

I've got rhino inside unity working on my home PC so I thought I'd set it up on my work PC as well and demo to the team. At work, I have Rhino 5, Rhino 6 and Rhino WIP installed. Rhino 5 and 6 are installed through a zoo server.

I installed the latest Rhino WIP and ran through the Unity setup as described in the documentation and Rhino is opening each time Unity boots - however, Unity freezes after Rhino WIP opens. When I mouse over the Unity Icon, I can see why:

hang

If I click into the 'Rhino 5 plugins...' window, it hides that window and shows a new Rhino document, but it will be unresponsive as well. Both Unity and Rhino will hang indefinitely. Once I navigate to the Rhino document, I can't get the 'Rhino 5 plugins...' window to show up on screen.

Opening Rhino WIP outside of Unity, I was able to click 'don't show this message again' on the popup but it didn't roll over to rhino inside unity. I am not getting this issue using Rhino inside Revit.

Need update

Old project , can't open any file and try it with visual studio 2019 and new softwares

Rhino inside Unity

Hi,

I'v been trying out rhino.inside in Unity, the example is working fine. i'm able to let rhino calculate some meshes and get the result back in unity.

Under window, i can start grasshopper.
Is it possible to get the result from grasshopper back in unity ?

Cheers,

RhinoCommon.Update.bat didn´t work

WIN10 Pro 1909, Rhino 7.02 WIP , Unity 2018.3.0f2
RhinoCommon.Update.bat didn´t work for me.

When I copied the RhinoCommon.dll manually from C:\Program Files\Rhino 7 WIP\System to ..\Sample1\Assets\Standard Assets\RhinoInside everything worked fine.

Unity + Rhino Microsoft.Win32.Registry

Hi.

The RhinoInside.cs file on Sample2 for Unity gives error that it does not find registry file:

Sans titre

I tried to create new project copy paste files for RhinoInside folder.
I do not have error on one computer but on other it gives an error.

Reference Grasshopper related dlls in Unity and resolve dependencies.

Targeting the Grasshopper api requires several dependencies. What is the appropriate way to reference these? I've copied Grasshopper.dll and GH_IO.dll to the Sample1\Assets\Standard Assets\RhinoInside directory.

Assembly 'Assets/Standard Assets/RhinoInside/Grasshopper.dll' will not be loaded due to errors:
Unable to resolve reference 'Microsoft.VisualBasic'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'Eto'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'Mono.Cecil'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'GH_Util'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'QWhale.Editor'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'QWhale.Syntax.Parsers'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'Yak'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'Eto.Wpf'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'Rhino.UI'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'QWhale.Common'. Is the assembly missing or incompatible with the current platform?
Unable to resolve reference 'QWhale.Syntax'. Is the assembly missing or incompatible with the current platform?

Any supports with AutoCAD?

The Rhino.Inside.AutoCAD source code don't have any update ,which already maintained 3 years. Any supports about AutoCAD in future?

Search Families by *Askerisk*

Is there any way to search and filter family types by using an asterisk (*) ? I am looking a way to find all family types which contain the word "Steel".

image

Probably this is already resolved but I couldn't find any information online so I post it here.

Many thanks,

"Add Column" component fails when changing input parameters

Hi Everyone,

I was wondering if anyone has experienced any issue with Add Column component of GH.Inside.Revit ( also sometime Add Beam component)? Unfortunately, it fails to update the model while playing with input sliders. Have checked on other machines and same result happens. A not ideal solution is to cut and paste the component back again to get the result with new inputs, but this way we lose the current model elements and all related documents. @eirannejad would be appreciated if you could advise. Please see below as reference.
image
image

VRay plugin doesn't load when Rhino ist started within Rhino.Inside

Working on Windows 10 Enterprise with Rhino 8 SR4 and Vray 6.20.02.

When I'm running the unmodified SampleWinFormsApp demo Rhino starts but shows an error saying that "Plug-in VRayForRhino.rhp can not be loaded". Does this plug-in require Rhino.exe to be the main process instead of a child process as with Rhino.Inside. Does anyone have any idea what the problem could be and how it could be solved?

RhinoLibrary loading

Hello,

It's a bit catastrophic, the examples don't work. suddenly it does not explain much.

They will search on NuGet, RhinoCommon.dll, Grasshopper.dll, ... and even RhinoInside. Is that normal ?

In the file DotNet/RhinoInside/Resolver.cs, line 39
double.TryParse(children[i], out double d) fails depending on the country.
use for example
double.TryParse("7.0", NumberStyles.Any, CultureInfo.InvariantCulture , out double b)

I only managed to make it work DotNet/WinFormsApp,
the others fail, often due to RhinoLibrary loading which applications cannot find.

why RhinoInside.dll is not directly in Rhino's directory ? (C:\Program Files\Rhino 7 WIP)

Using Rhino.Inside + Grasshopper from a referenced project

Hi there, I have a WIP project for debugging that execute GH definitions inside UnitTest methods using the MSTest framework, let's call it Project A (Tenrec), is where Rhino.Inside things happens. I have a secondary project, called project B (SampleTest1), which is a sample use case.

The Rhino.Inside part works as expected in project A but when I use it from project B, I got a .dll not found exception.
System.IO.FileNotFoundException: Could not load file or assembly 'Grasshopper, Version=7.6.21127.19000, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803' or one of its dependencies. The system cannot find the file specified.

I have the same references in both projects, for instance, what I did was to get the nuget package of RhinoInside and update its dependencies (Rhinocommon, RhinoWindows and Grasshopper) to the latest stable release 7.6.21127.19001. However, the version that is being referenced in mi project is 7.6.21127.19000. I don't know if this is an issue or it is irrelevant, but just in case I show you:

image

In both projects, the package.config looks like this:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Grasshopper" version="7.6.21127.19001" targetFramework="net48" />
  <package id="MSTest.TestAdapter" version="2.2.4" targetFramework="net48" />
  <package id="MSTest.TestFramework" version="2.2.4" targetFramework="net48" />
  <package id="Rhino.Inside" version="7.0.0" targetFramework="net48" />
  <package id="RhinoCommon" version="7.6.21127.19001" targetFramework="net48" />
  <package id="RhinoWindows" version="7.6.21127.19001" targetFramework="net48" />
</packages>

THE PROBLEM
And when I run a test in project B that looks like this:

  [TestMethod]
  public void TestMethod1()
  {
    // This method belongs to project A and calls Grasshopper.dll while RhinoCore is being used.
    Tenrec.Utils.RunTenrecGroup(@"whatever gh filepath", groupInstanceID);
  }

I got this exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Grasshopper, Version=7.6.21127.19000, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803' or one of its dependencies. The system cannot find the file specified.

For other side, the AppDomain.CurrentDomain.AssemblyResolve, as you can see in https://github.com/DanielAbalde/Tenrec/blob/251faef2a3757a7d4bb07afff47feb30d4193873/Headless.cs#L44 is referencing the versions of Rhino/GH located in RhinoInside.Resolver.RhinoSystemDirectory, which are 7.7.something my current installation.

I have tried things that have broken everything and I have finally got it back to working as before so I really need your help here.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.