Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all 8550 articles
Browse latest View live

Type is defined in an assembly that is not referenced (Visual Studio with RhinoCommon) [Solved]

$
0
0

@Ivan1 wrote:

Hello,

I have been trying to compile a visual studio project that contains a lot of Rhino Plugins lately and while I had a lot of errors at the beginning (around 400 compiler errors),

I managed to reduce almost all the errors. Mostly they were of the following type: "some external namespace" couldn't be found. I then installed all the necessary nuget packages and visual studio extensions through the Visual Studio Gallery online (QuickGraph, Newtonsoft.Json, Eto.Forms, etc. for example) ...

...and now I am down to only having one error which I can't handle myself.

The compiler error I get is the following:

CS0012 - The type "DialogResult" is defined in an assembly that is not referenced. You must add a reference to assembly "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

It appears to me that the standard Windows.Forms Dialog namespaces are colliding with the Rhino.UI. Here is the code: The second line is underlined red.

var dlg = new Rhino.UI.OpenFileDialog { Title = "select file", DefaultExt = "json" };
dlg.ShowDialog();

I installed the RhinoCommon templates v5, I even added RhinoCommon.dll manually.
I have Rhino 5 for Windows installed as well. I am using Visual Studio 2015 with Xamarin (because we want cross platform GUI functionality).

I hope someone can help me fix this very Windows-specific issue (as it appears to be).

Ivan

Posts: 4

Participants: 2

Read full topic


Create a new displaymode in c#

$
0
0

@suc_kiet wrote:

Hi;
In rhino I cant creat a new displaymode by Options > View > DisplayModes , it is some way to creat it by c#?

Posts: 1

Participants: 1

Read full topic

Insert a button into a document

$
0
0

@lscandella wrote:

Hello Forum,

I'd like to be able to insert a button into a document as if it was a geometric entity. Then I'd like to be able to run a plug-in command when the button is clikked. Is it possible?

Plan B. Can I define a side effect when the user selects an entity? If yes can I associate it to a plug-in command in order to achieve the target I mentioned?

Thanks. L

Posts: 1

Participants: 1

Read full topic

DrawPolygon - Concave shapes

$
0
0

@PaulPoinet wrote:

Hi,

I am drawing polygons with the DisplayPipeline.
It seems that it handles only convex shapes.
The input points for the polygon (filled) are the same as the ones used to create the naked curve.
Have I done something wrong?

Posts: 1

Participants: 1

Read full topic

Is dotnet (rhinocommon) paying off?

$
0
0

@Sander_Boer wrote:

Hi,
This is a question for the core developers. I had a talk with steve baer a couple of years ago and I remember him being enthousiastic about rhinocommon in particular and dotnet in general.
I took this as futureproofing rhino, a multiplatform future. Osx was on the rise and work was being done to get rhino mac ready.

Now a couple of years later I think it is safe to say that rhino mac has been a struggle and it feels like developing with dotnet has not helped in that regard. Like, at all.

Now, I regularly have dicussions with microsoft fanbois about dotnet and I do a fair bit of c# myself in grasshopper and unity. I can see the appeal of more readable code, but fundamentally al the friction points are still there, f.i. include hell and build spaghetti to name but two. Especially building and linking is very opaque now.

The reason I bring this up is because dotnet feels more and more of a lock-in and I worry about the path microsoft is taking, windows 10S being the latest shenanigan.

My question to the devs is this: did dotnet pay off ? I don't mean did it work, but is developing with dotnet a path into the future? Or should one take serious steps in being multiplatform like f.i. blender has done ? I bring this up bc when I develop an app I notice a great demand for multiple platforms. Mac and win being a main concern, but mobile and web coming in as close seconds. I have used lightweight libs like oryol and raylib with great ease, a pleasure compared to f.i. qt.

So, again, dotnet/rhinocommon: "OMGbestDecisionEVErrr! Msvc 4eva!" or "meh, seemed like a good idea at the time" ?

Thx.
Sander

Posts: 1

Participants: 1

Read full topic

CRhinoUiFontComboBox

$
0
0

@fthomas wrote:

Hi
Does anybody know how to use the "CRhinoUiFontComboBox" control ?
Just add a member do nothing... combobox is always empty !

Posts: 1

Participants: 1

Read full topic

Highlight points/edges/faces over a mesh? (C++ SDK)

$
0
0

@pagarcia wrote:

Hi,

I'd want to dynamically highlight (i.e. draw with other color/shading) a point/edge/face of a custom mesh when dragging the mouse over it, to later apply a transform. The selection boils down to points (i.e. selecting an edge will select 2 points and a face will select 4 points). What's an easy, simple way to do it?

Many thanks,
Pablo

Posts: 1

Participants: 1

Read full topic

When Compiling Plugin-Project no .rhp-file is created in my bin Directory

$
0
0

@Ivan1 wrote:

Hello,

so when I compile this RhinoCommon Plugin-Project that I started working with the last few days, the Rhino software opens up Rhino (untitled) which is fine. But when I type in the PluginManager-command to then install the plugin, I can't find the therefore necessary .rhp-file neither in the bin directory where it is supposed to be nor in any other directory of the project.

I am using Visual Studio 2015 on a windows machine.
There are lots of commands inside the project.

I hope someone can help me figure this mess out.

Posts: 4

Participants: 2

Read full topic


[Resolved] Greville point grips on - RhinoCommon

$
0
0

@Alberto wrote:

Hi,
I would like to have my own (rhinocommon) command that (among the other things) turn on the greville grip point like _EditPtOn. Is there a way to do that? If I set curveObject.GripOn = true I got the control point grips. I tried calling RhinoApp.RunScript("_EditPtOn", true) but it does not have the hoped effect. Any suggestion?

Thanks a lot
Alberto

Posts: 3

Participants: 2

Read full topic

Rhino python equivalent to Matlab 'boundary'

$
0
0

@Cicero wrote:

Does anyone have any suggestions on how to produce a polyline boundary from a set of points, much like Matlab's 'boundary' function? It's important that the result is not 'self-crossing'. I've tried 'SortPointList' with little success.
The result in Matlab can be seen in the attached image:

Posts: 4

Participants: 3

Read full topic

Bug while trying to zoomExtend a detailView

$
0
0

@Matthieu_from_NAVINN wrote:

Hi,
I've got an issue when trying to ZoomExtents a DetailViewObject:
*If I set as active the detailView it seems to work, but as soon as I set back as active the pageView, everything is cancelled.
*Even stanger: If I breack the code with a dummy user action, it works! (for exemple: RhinoGet.GetBool("PressEnterToContinue", True, "", "", True)

I think this some kind of commit bug, here is my code:

   `Dim CoverSheetpageview As Rhino.Display.RhinoPageView = TryCast(doc.Views.ActiveView, Rhino.Display.RhinoPageView)
        CoverSheetpageview.PageName = "CoverSheet"
        Dim CoverSheetdetailview As Rhino.DocObjects.DetailViewObject = CoverSheetpageview.GetDetailViews(0)
        CoverSheetpageview.SetActiveDetail(CoverSheetdetailview.Id) 'activer le premier détail de la page en cours (a généraliser)
        CoverSheetdetailview.Viewport.ZoomExtents()
        CoverSheetdetailview.CommitViewportChanges()
        CoverSheetdetailview.CommitChanges()
        CoverSheetpageview.Redraw()
        'Désactiver le détail
        RhinoGet.GetBool("PressEnterToContinue", True, "", "", True)
        CoverSheetpageview.SetPageAsActive()
        doc.Views.ActiveView = CoverSheetpageview
        CoverSheetpageview.Redraw()`

Posts: 1

Participants: 1

Read full topic

Create Brep from Curves

CRhinoUndoEventHandler troubleshooting

$
0
0

@pagarcia wrote:

Hello,

I need help to handle a custom CRhinoUndoEventHandler.

My plugin adds custom mesh objects into the document, each of them having an instance of custom ON_UserData attached. The commands receive some user interaction as input, update the user data and replace the object with an updated mesh.

From Dale's SampleCustomUndo I see that my CRhinoUndoEventHandler should have as member an instance of my data (which will store its "old" version before the user does Undo), and inside the virtual Undo I should code the way of doing Undo operation. Inside my plugin, I'd use AddCustomUndoEvent with the current data before running any command.

However, I have three crucial questions:

1) When I write data, I don't know whether it's my ON_UserData or the linked CRhinoMeshObject that "lives" in the document, or both.

2) For me, my custom user data and the mesh object are the same: when an instance of user data is updated, its corresponding mesh is updated and replaces the old one. In the undo event handler, where do I perform the operation of replacing the last mesh with the old one?

In the header I read "Never change any setting in the Rhino document or application", which leads me to confusion (whether the operation of replacing a mesh is a change of settings, etc).

3) In Dale's sample I see that the operations coded in Undo modify an instance of data (a double value) that is a private member of CRhinoUtilityPlugIn. Why is this necessary? I assume that it is for easy tracking of the data to be "undone", but what's the way to do it with multiple objects that are in the document?

For example, I have a command that takes as input 2 custom meshes A and B and as output gives two new meshes C and D, being C the updated version of A and D the updated version of B. If the user does Undo and I want to recover A/B from C/D, I don't know how to track them properly from the members in the undo handler and the document.

Any idea or hint will be very appreciated!
Pablo

Posts: 3

Participants: 2

Read full topic

C#, How to stop Command from executing by checking the conditions in Command.BeginCommand?

$
0
0

@Arif_Hatim wrote:

Hello!

I'm currently having a requirement that require me to check the current condition before executing new Command. So what I'm trying to do now is to have the condition checks in "Command.BeginCommand" event and if it does not meet the condition, do not execute the Command.

However the problem is, in "Command.BeginCommand" does not have any return values to indicate if the command is to be canceled. Are there any other ways to achieve this without needing to implement the checks in every commands class?

Posts: 5

Participants: 2

Read full topic

Getting animation range through script (duration, current frame, etc.)

$
0
0

@Paolo_Acampora wrote:

Hello,

is there any way we can get information about animation in a rhino scene? All I could find are the "player" commands (next frame, previous frame, last frame). Is there any way we can get the current frame and the last frame inside a script (either python or rhinoscript)?

I could not find anything, but I could see that VRay is able to stop at the last frame when rendering an animation.

Any tips?

Thanks,
Paolo

Posts: 1

Participants: 1

Read full topic


Orient3Pt in rhinocommon

$
0
0

@Christoph1 wrote:

Dear all,
what would be the equivalent rhinocommon (c#) function for Orient3Pt?
Thanks a lot,
Christoph

Posts: 3

Participants: 2

Read full topic

[RhinoCommon/C++] SimpleArrayDouble does not work when initialized with a list of values

$
0
0

@menno wrote:

var list2 = edgeParameters.Values.SelectMany(l => l).ToList(); // contains values
SimpleArrayDouble predefinedEdgeParameters = new SimpleArrayDouble(list2);
var pdp = predefinedEdgeParameters.ToArray(); // has length 0

I'm on R5SR12; I'm not sure about V6

Posts: 1

Participants: 1

Read full topic

Add Text at mouse cursor position

$
0
0

@feibih wrote:

Hi
I'm trying to add text exactly at the position of the mouse cursor.
But I'm having trouble getting the position where the mouse is on the Rhino screen
Below is my code.

        Rhino.Display.RhinoView view = doc.Views.ActiveView;
        Transform xform = view.ActiveViewport.GetTransform(
        CoordinateSystem.Screen,
        CoordinateSystem.World);
        Point3d pt = new Point3d(?????.X, ?????.Y, 0.0);
        pt.Transform(xform);

        Plane position = doc.Views.ActiveView.ActiveViewport.ConstructionPlane();
        position.Origin = pt;
        Guid te = doc.Objects.AddText("test", position, 7, "Arial", false, false);

        doc.Views.Redraw();
        return Result.Success;

Would someone have a solution for this?
Thanks

Posts: 1

Participants: 1

Read full topic

Custom undo/redo with Brep

$
0
0

@jordy1989 wrote:

Hi all,

What I have made is a function to smooth/adjust a Brep through mouse movement. When I call the function a dialog will be shown with Dialog.Show (not ShowDialog). This way the function will continue to the end and the dialog will stay open. I can hold my left mouse button and move it around for adjustments. Because the function has already ended after after Dialog.Show it will not track the adjustments to the object.

How can I add this Brep to the undo/redo list or maybe add a custom Undo/Redo?

Thanks for reading.

I am using RhinoCommon in vb.NET

Posts: 2

Participants: 2

Read full topic

Using Rhinocommon for standalone application

$
0
0

@samlochner wrote:

I read that Rhinocommon is now opensource. For a standalone application, would it be Rhino3dmIO that I use? I'm trying that now but finding I'm missing a lot of the functions, like Mesh.CreateFromBrep. Perhaps there is something that I'm not understanding?

Thanks,
Sam

Posts: 5

Participants: 3

Read full topic

Viewing all 8550 articles
Browse latest View live