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

Boolean Difference

$
0
0

Hi,

I would like to ask when Boolean difference fails and to avoid these cases.
I have a case below that is not possible to cut from the grey geometry (Rhino File attached).

Could someone give guidelines considering tolerance and cases that would work?
I was trying to find an error prone process for boolean difference for quite some time, but always there are cases where it fails. RhinoCommon behaves the same. I do not mind waiting for a longer time, but I really need cut volumes that are often coinciding with existing edges or surfaces.

BooleanDifference.3dm (229.6 KB)

1 post - 1 participant

Read full topic


C# WPF error reporting

$
0
0

Hello,

I usually debug by sending messages to the console via RhinoApp.WriteLine but I’ve recently encountered a very stubborn bug that I would like to collect more information about. The application is a WPF plugin for Rhino.

I have tried using other error and exception reporting processes (without luck) such as:

Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;

Can anyone please advise a best practice for catching errors before a WPF rhino plugin/application crashes?

Sincere thanks.

2 posts - 2 participants

Read full topic

Numeric input for custom gumball

$
0
0

Hi,
I have been looking if it is possible to have numeric input via text on a custom gumball we have developed. Our users would like to input precise values when using the gumball. I have checked the API but it does not seem to be supported. I am missing something?

Thanks a lot,
Alberto

1 post - 1 participant

Read full topic

Change position of a geometry in c#

$
0
0

hi
how can i change postion of my Object in runtime ?

imagine i have a curve
i used this code but didn’t get good result

doc.Objects.Transform(playerBody, Transform.Translation(new Vector3d(body.Position.X, body.Position.Y, 0)), true)
it just move my object for example if i run this code at loop my object move , move and move to inifinity

i want to change just postion of my object

4 posts - 2 participants

Read full topic

AddOptionList values

$
0
0

Hi there,

Can someone help me? I put texts in the listValues inbetween two quotation marks, however the script does not work when I use space or put only number.

Works:
listValues = “Solid”, “5mm” , “10mm”, “100mm”

It doesn’t work with space as “Solid geometry”
listValues = “Solid geometry”, “5mm” , “10mm”, “100mm”

It doesn’t work with number as “100” instead of “100mm”
listValues = “Solid geometry”, “5mm” , “10mm”, “100”

import Rhino
import rhinoscriptsyntax as rs

    def options():
        gs = Rhino.Input.Custom.GetString()
        prompt = gs.SetCommandPrompt("Specify profile? [Press ENTER]")
        listValues = "Solid geometry", "5mm" , "10mm", "100mm"
        listIndex = 0
        thickness = listValues[listIndex]
        opList = gs.AddOptionList("List", listValues, listIndex)
        while True:
            get_rc = gs.Get()
            if get_rc==Rhino.Input.GetResult.Point: # Alapertekkel (Default)
                print "Command line option values are"
                print " List =", listValues[listIndex]
            elif get_rc == Rhino.Input.GetResult.Option: # Ha belepunk a listaba
                if gs.OptionIndex()==opList:
                    listIndex = gs.Option().CurrentListOptionIndex
                    thickness = listValues[listIndex]
                continue
            elif gs.StringResult():
                thickness = gs.StringResult()
            break
    if __name__ == "__main__":
        options()

2 posts - 2 participants

Read full topic

C#, WPF interface help with background workers

$
0
0

Hello everyone,

I’ve been wrestling with a Rhino development problem that involves WPF and background processes and decided to post this due to the reply generated by a previous post (thank you, Tom).

Enclosed is a ‘shell’ project that contains most of the processes used by the mentioned problem. Please note that I decided to keep the application as a stand-alone rather than attach it to a rhino process but I can do that work if needed.

My problem is this:

I have built a multithreaded plugin that uses various background processes (for example computational processes for a rhino model), two of which get chained together through a WPF interface.

ie.
WPF interface button click lets user start process
The model behind receives click event and triggers the background worker chain to start.
Chain completes tasks and then updates interface.

The problem I have been having is that some events, for example updating a WPF slider cause the application to crash. This version of the project is not crashing. I’m still trying to work out exactly why that is but decided to post this anyway.

Tom if you read this you mentioned the use of notify. I’ve not ever used that process before. I suspect it’s a very simple change to make but hope you, or someone else can take a look at this project and provide a hand / some advice or help. Not sure if this is just a notify problem or a variable binding problem with the Slider.maximum property.

Many thanks in advance.

WpfApp11.zip (96.8 KB)
(Edited to more closely mimic the process)

1 post - 1 participant

Read full topic

Question about the EtoCollapsibleSection

$
0
0

I have a Form which contains EtoCollapsibleSection(s) and I would like to perform an action (enable/disable a DisplayConduit) when the section is expanded or un-expanded. Is there a way to do this?

2 posts - 2 participants

Read full topic

Best practice or technology for WPF or XAML cross platform GUI development?

$
0
0

Hello,
I am curious if anyone here has experience developing WPF or XAML interfaces for cross-platform rhinocommon apps/plugins - and even if this is actually possible!

If it is possible thoughts about the best approach would be appreciated.

Sincrely,

1 post - 1 participant

Read full topic


Events triggering twice

$
0
0

Hi,

I am really stuck in this problem and couldn’t find why it is happening after many debuggings. It is happening in both Rhino and Eto.Forms events.

I know it is hard to understand without seeing whole code but, maybe you know why it is potentially happenning.

I have some lists that MyPlugin handle it’s operations with them and I am cleaning this list after deselection.

// Registration method for constructor
private void RegisterControlEvents()
{
     RhinoDoc.SelectObjects += RhinoDoc_OnSelectObjects;
     RhinoDoc.DeselectAllObjects += RhinoDoc_DeselectAllObjects;
}

// Sample of handler
private void RhinoDoc_DeselectAllObjects(object sender, RhinoDeselectAllObjectsEventArgs e)
{
    SelectedPluginObjects.Clear();
    SelectedCurves.Clear();
}

PS: I am sure, there is no another subscription for this event

What am I missing?

Thanks in advance

1 post - 1 participant

Read full topic

C# get rotation of Geometry

$
0
0

how can i get current rotation of an geometry
i get geometry by using doc.Objects.FindGeometry(guid)
and now i want to get rotate of this object

3 posts - 2 participants

Read full topic

Plugin Compatibility - intermittent issue

$
0
0

Hi folks,
So in the last month or so, I have had three users come to me with the same issue. The compatibility check failed my plugin. Pachyderm is compiled for Rhino 5, but it has worked in Rhino 6 with no issues for several years now. I can usually get them going if I can get them to install the plugin on another computer… however, this is a hardship for some of them, as they may be students or from a part of the world of lesser means.

Does anyone have a sense for what might be causing the plugin compatibility check to fail? Needless to say, it works fine on my machine.

kind regards,

Arthur

3 posts - 3 participants

Read full topic

RmaErrorReporting.exe

$
0
0

Hello, Anyone knows why this error occurs when I run a c# plugin in Rhino5? There is a Rhino instance running, but if I try open another instance, crash
ThanksRhinoCrashDump.rar (4.5 MB)

2 posts - 2 participants

Read full topic

Use RhinoDoc.CreateHeadless without an open Rhino Document

$
0
0

I’m trying to create some unit tests for a Rhino Plugin.
I’ve tried running the following without Rhino open.

RhinoDoc doc2 = Rhino.RhinoDoc.CreateHeadless(null);

But when I do I get lots of errors, such as 'Unable to load DLL ‘rhcommon_c’ or ‘BadImageFormat’ amongst others. However when I run this exact code inside of Grasshopper it runs perfectly.
Does this code only work when run inside of a Rhino Instance?

All I need for my tests to work is a Rhino Object, but I do not believe I can get one of these without a document.

2 posts - 2 participants

Read full topic

Custom object properties page in C++

Rhino's Material table; Triangles in icon corners

$
0
0

I’m trying to work with layer render materials, but I found there seems to be two types of materials. In the materials tab one type has triangles in the icon corners and the other does not. If I create the material manually the icon has triangles in the corners, if I do it programatically it does not (at least the way I do it). In Rhino 6 is seems to be the other way around.
The problem I’ve got is that I can only get layer.RenderMaterial.Name and layer.RenderMaterial.Id if the icon has corners. Are there two types of render materials? How do they work?

2 posts - 2 participants

Read full topic


Custom script for comparing changes/layers within two or more files

$
0
0

Hey there,

I have the following challenge and looking for a way to automate the process if possible.
Any feedback or suggestions would be highly appreciated.

There are multiple Rhino files (over 10-20) that are all “work in progress” files with hundreds of layers. My goal is to organize all of them. Instead of doing this manually, I would like to systematize the “scanning” of these files and compare 2 or more files at once and get an output of what is “different” between them, what are the extra layers added, what is the extra geometry added etc, so I have a better idea what’s the difference between files as they all look pretty similar, but there are some small changes done within each one of them. I’m looking to find these changes.

Any suggestions or pointers? Is there a script that can do something like this?

Thanks!

3 posts - 3 participants

Read full topic

Seepd up GroupTable.Delete()

$
0
0

Hi,

I need to purge many groups from the group table ( about 2k empty groups).
This takes many minutes as I did not find another way than to iterate over the group indices to delete and pass them one by one to GroupTable.Delete(int)

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_Tables_GroupTable_Delete_1.htm

I do it in python like so:

    for i in group_indices:
        sc.doc.Groups.Delete(i)

Is there another way to speed this up, maybe an overload to pass an array of indices?

Thanks,
-Willem

6 posts - 3 participants

Read full topic

How to ON_Brep in C#?

$
0
0

Hi

I try to get ON_Brep elements from c++ in c#, But it doesnt show any brep element in Rhino, Code has no error, but in console there are some brep Elements in list(I check with using gettype and count), but not show in Rhino. If anyone can help or give me some tipps for that?

My Code is something like
getting IntPtr from Interop.NativeGeometryNonConstPointer
and then getting Brep from Interop.FromOnBrep

I also dont know how to use this both Methods in the right way.
with lines, polylines or normal calculate from Native Methods works fine but with Element like Brep, Mesh ect., I can not do it.

Regards,
Jira

2 posts - 2 participants

Read full topic

Zoo licence manager

$
0
0

Hi
Does Zoo licence manager works with Rhino5 commercial version??

2 posts - 2 participants

Read full topic

How to know if face is trimmed or not

$
0
0

Hi,

I’m at a loss at how to find if a brep face is trimmed or not.
Is there some property of it’s edges, trims, loops or such to find if it’s boundaries coincide with the underlying surfaces edge(s)?

Thanks
-Willem

Note: the reason for my query is that it seems that Brep.CreateTrimmedSurface() fails if the input face is “untrimmed”
My larger goal is to rebuild a face’s surface and recreate the face including trims with that rebuild surface.

3 posts - 2 participants

Read full topic

Viewing all 8616 articles
Browse latest View live