Quantcast
Channel: Grasshopper Developer - McNeel Forum
Viewing all 3656 articles
Browse latest View live

Input as list


HTTP request when Plugin is called from Grasshopper

$
0
0

@cidelab wrote:

Hi,
I need to creates an HTTP request before the plugin is loaded in Grasshopper. If the return is not satisfactory the plugin will not be loaded.
any clue will be very helpful
thanks in advance
Carlos.

Posts: 6

Participants: 3

Read full topic

Code Completion for ghpythonlib.components (node-in-code) in Visual Studio

$
0
0

@frist wrote:

Hi,
I did some work on remote debugging again and it works very well with Rhino 6 WIP and the Python Tools for Visual Studio. Now I'm trying to get all the benefits form using Visual Studio as an editor for GhPython scripts, mainly I want a working object browser and code completion and help (IntelliSense). That's not problem for thinks like rhinoscriptsyntax but I don't know a good way to get it to work with ghpythonlib.components.

I could see a way to use the introspection to generate s kind of dummy library containing only definitions and the docstrings for all the Grasshopper components, but it's probably quite a bit of work there is probably a better way.

Any ideas?

See you
Florian

Posts: 1

Participants: 1

Read full topic

Referring to built-in GHAs in project

$
0
0

@andheum wrote:

I wish to be able to use classes defined in some of the assemblies shipping with Grasshopper - like Transform and Vector - in a plug-in I am writing. So far I have not been able to refer to the GHA files directly as references:

I can make a local copy of the GHA, rename it as a DLL, and then add it as a reference set to copy-local=false... but this seems a little clunky to me. Is there a proper way?

Posts: 2

Participants: 2

Read full topic

Showing/Hiding Objects

$
0
0

@PaulPoinet wrote:

Hi all,

It seems that one can show/hide objects only by calling the ObjectTable class from where they belong. Is there an alternative to that?

If not: what should I do if I want to show/hide an object that does not belong to the Rhino.RhinoDoc.ActiveDoc.Objects class?
I considered adding the object to a new ObjectTable but it seems that this class does not have any constructor. Is there no way to instantiate a new ObjectTable? I am kind of stuck here....

Any hint?

Paul

Posts: 11

Participants: 3

Read full topic

LayerTable max depth

How to set scale and target of detail?

$
0
0

@Jakob1 wrote:

Hi,

This is probably a python/rhinoCommon beginners question, but I cant seem to solve it on my own.

I want to create a layout, add a detail view to the layout (top view, but preferably changeable to any other 'standard view'). So far I have managed this by:

if RUN == True:
    rs.AddLayout(name, size)

for layout in sc.doc.Views.GetPageViews():
sc.doc.Views.ActiveView = layout
layout.AddDetailView(name + '1', corner1, corner2, r.Display.DefinedViewportProjection.Top)

I then want the detail view to center over a target point in the rhino document and zoom so it shows the objects in the detail in a certain scale. Should I first create a DefinedViewportProjection that is centered over the target, and then use this to add the detail, or should I rather move the camera after creating the detail? I can't find a method to set the camera of a detail view or zoom. Please help!

Posts: 5

Participants: 3

Read full topic

Multiple instances of a custom preview gh component

$
0
0

@PaulPoinet wrote:

Hi,

I am scripting in C# a component that has a lot of custom previews implemented within a display pipeline (please refer to this thread). I noticed that when I instantiate this component multiple times, either by inputting multiple objects (from outside the component) or by simply copy-pasting it, the display pipeline is completely messed up. It seems impossible to preview more than one instance of the same script/gh component.

Any hint on how I can fix this?

Paul

Posts: 7

Participants: 3

Read full topic


Rolling Ball Fillet with changing radius

$
0
0

@Boleslaw wrote:

Hi, I was trying to create a rolling ball fillet between two pipes. The tricky bit is that one of the requirements was to keep various radius in different segments of the joint. I used CreateRollingBallFillet method from Rhino Common, but this allows you to have a fixed radius only. I had to create multiple sections, based on multiple fillets, and finally do a loft with those sections in order to get the desired result.

This works, however it's quite inefficient. If I want to it to be precise, I need to take hundreds of sections, that means generating hundreds of rolling ball fillets... that obviously takes time to calculate. Is there any chance to get various radii on that method? Or is there any reasonable workaround? Could by any chance McNeal implement a variable radius fillet in RhinoCommon API?

Thanks!

Posts: 1

Participants: 1

Read full topic

Variable number of inputs in node

$
0
0

@cidelab wrote:

Hello to all,

I need to increase or decrease the number of inputs in a Node. Same as the node merge or the node Entwine in GH. So when you press (+) you have another input and when you press (-) you cancel that input.

Can anyone help with some guidance?

thanks in advance
Carlos

Posts: 3

Participants: 2

Read full topic

Using member of GH_PersistentParam without knowing

$
0
0

@lightShell wrote:

Hi,

I want to clear the persistent data in one of my custom components:

var param = Params.Input[0];      // is GH_Param<T>
???                               // Casting to GH_PersistentParam<T> for the following action
if (param != null) {
    param.PersistentData.Clear();
    param.OnObjectChanged(GH_ObjectEventType.PersistentData);
}

My current solution casts to every possible class (Param_Curve, Param_Surface, ...) until success. But as I'm not using <T> at all, I guess there is a simpler, less performance / maintenance prone method.

I know it's a general C# / Generics issue but maybe someone here can help. Thanks!

Posts: 2

Participants: 2

Read full topic

Best way to retrigger 'SolveInstance'

$
0
0

@Jed wrote:

Hello,

I'm trying to create my own UDP receiver (similar to gHowl), but I'm having trouble with one thing. I'm able to receive the signals correctly, however the only way I can think to get continuous input is in a loop. An infinite loop locks up the plugin, so I tried calling solve instance after I receive the info, however this also locks up the program.

Is there a safe way to call solve instance again and allow it to finish? If I have an input slider and drag it, solve instance gets called again appropriately, but is there a way to simulate this via code?

Posts: 2

Participants: 2

Read full topic

GH: Dynamic CPlane with GhPython?

$
0
0

@RIL wrote:

I would like to be able to dynamically generate the Plane, for example using GhPython, and then feed the Plane into another GH component? (The Plane depends on user interaction, in 90 degree flips), for example like so :

Or is there a smarter way of achieving a "flippable plane"?

// Rolf

Posts: 8

Participants: 3

Read full topic

Ho to test for null objects in GhPython?

$
0
0

@RIL wrote:

I try to filter away some Null points from a list with GhPython but trying the following code I still end up having 24 Null points in my lists... :slight_smile:

import rhinoscriptsyntax as rs
import Rhino

if pt_list:
    P = []
    for pt in pt_list:
        # Tried both variants below, but no go
        if pt:                 <- Does not filter away
        if pt is not None:     <- Does not filter away
            P.append(pt)

I searched for "Null" but no hits.

// Rolf

Posts: 5

Participants: 3

Read full topic

GHA COFF or Direct loading

$
0
0

@menno wrote:

Hi @DavidRutten

I ran into the same problem as the author of this post: http://www.grasshopper3d.com/forum/topics/how-to-define-per-gha-loading-mechanism

Somewhere on the second page you said:

Ah indeed. With _GrasshopperDeveloperSettings Memory Load option enabled and the load mechanism set to Plugin Default, the plugin doesn't win. That's clearly a bug.

I wonder if this ever got solved? I think I see the same: I define the assembly attribute

[assembly: GH_Loading(GH_LoadingDemand.ForceDirect)]

but Grasshopper only loads direct if the option is switched off in the developer settings. Before digging deeper, let me know if this problem has been solved or not. Thx!

Posts: 1

Participants: 1

Read full topic


C# component with Split Tree Input

$
0
0

@BruceHilbert wrote:

Greetings:
I'm writing a C# component that will be parsing a large data tree and I'd like the user to be able to input Split-Tree like parsing notation. For example:
{1;3-5}
to select all branches that start with 1 and end in 3, 4, or 5. Is there a simple way to go about that? Some input type I've missed, perhaps? I see AddPathParameter but I have no idea what it is.

Posts: 1

Participants: 1

Read full topic

Save data from Net on Gh Component

$
0
0

@kaveh_Alla wrote:

Hi, everyone
Well, I am writing this c# script-component, which has to recieve data from UDP(network) or within Grasshopper if no UDP recieved. In case a valid UDP recieved I want to save it in Component/ Gh file so it persists and not necessary to continue sending udp s!
For that I tried to write on GH file itself, it works . Problem happens when two or more on the active canvas should be added.
I used: an "GH_archive object then writeToFile method
I can not use the write() method , not for component or GH_Archive s ad they need GH_IWriter type and it is Interface
and can not be initialized.
the data i have is of double[] type.

I would be very thankfull for any hint/ help!
cheers, Kaveh

Posts: 5

Participants: 2

Read full topic

Dll documentation inside Grasshopper node?

$
0
0

@cidelab wrote:

Hello to all,

when I load my DLL into a grasshopper node (C#), I can't see the DLL documentation.

I comment my classes like this:
example:
///


///

        /// <param name="sizePopulation"></param>
        /// <param name="sizeChromosome"></param>
        /// <returns>Population double[][]</returns>

Should I commented in a different way? or create a chm file?
thanks for the help

all the best
c.

Posts: 2

Participants: 2

Read full topic

RhinoCommon.dll missing on VM

$
0
0

@RIL wrote:

Edit: Found it. manually. But why doesn't Win10 search find such a file? Unbeliveable...)

I installed VS 2015 on a VMware machine and the GrassHopper templates. The GH template in VS asks about a path to RhinoCommon.dll but I find no RhinoCommon.dll on the VM (of course) but not my regular machine either (which has Rhino installed)

I downloaded RhinoCommonWizards.msi but that doesn't contain any RhinoCommon.dll either.

So how do I fix this?

// Rolf

Posts: 18

Participants: 4

Read full topic

Add native .NET assembly reference to Component (eg. System.Net)

$
0
0

@atair wrote:

I can reference external DLLs, but what to do if I need to use standard .Net libraries like System.Net.Sockets others that are not listed by default? (In a scripted component, c#)

Posts: 4

Participants: 3

Read full topic

Viewing all 3656 articles
Browse latest View live