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

RhinoCommon Rhino.UI.Dialogs.ShowTextDialog limitation

$
0
0

@Willem wrote:

Hi,

I'm trying to display a long string with Rhino.UI.Dialogs.ShowTextDialog
however beyond a certain size, the string is no longer displayed anymore.
Any thoughts on what might cause this?

import Rhino

rl = 'fill fill fill fill fill fill fill fill fill fill fill fill \n'
message = ''
for i in range(33):
    message +=  rl

#this text shows
Rhino.UI.Dialogs.ShowTextDialog(message,'report')

message += 'add this final line and see if it shows'
#adding an addition string and it does not show again
Rhino.UI.Dialogs.ShowTextDialog(message,'report')

Thanks
-Willem

Posts: 4

Participants: 2

Read full topic


RhinoDoc.SelectObjects + filter

$
0
0

@karol_wierzbick wrote:

Hi,

I have assigned my own event to the RhinoDoc.SelectObjects, however it doesn;t run when selecting objects with use of filter, for example when I run command "Select surfaces" this event RhinoDoc.SelectObjects doesn't run. Is there any other event I need to overwrite? I use C#

Posts: 2

Participants: 2

Read full topic

How to select objects that are visible within one Detail

$
0
0

@MartinIC wrote:

Hi,

I created a layout with one Detail on it.

In Rhino Model Space there are also a lot of objects that are not visible in this particular Detail view.

How could I select (get all the Guids) of Objects that are visible in a particular Deail View?

Thanks
Martin

Posts: 4

Participants: 3

Read full topic

Surface as preview

$
0
0

@Alberto wrote:

Hi,
sorry to open a new topic but I cannot find anything in the fourm that helps me. I would like to add some surfaces only as a preview and not as actual data of the document. Is there a way to achive this?

Thanks a lot
Alberto

Posts: 6

Participants: 2

Read full topic

Delete a hidden objects

$
0
0

@mprades wrote:

Hi guys.
How I can delete a hidden object?

I found this http://discourse.mcneel.com/t/doc-objects-delete-bug/7808, in this foro

    ObjectEnumeratorSettings s = new ObjectEnumeratorSettings
    {
    HiddenObjects = true
    };
    var hiddenObjects = doc.Objects.GetObjectList(s);
    foreach(var obj in hiddenObjects)
    {
       obj.IsHidden = false;
       obj.CommitChanges();
       doc.Objects.Delete(obj, true);
    }

But IsHidden has not a setter?

Somebody can help me?

Thanks in advance.

Posts: 3

Participants: 2

Read full topic

Delete hidden objects

Surface from closed planar curve? (rhinocommon)

$
0
0

@lungenstrudel wrote:

hey guys,
i am searching for a way to get a trimmed surface from a closed planar polycurve (in my case a polygon, only straight edges). is there a dedicated method or will i have to tinker with breps? if so, what's the easiest way to achieve that?

best, heinz.

Posts: 5

Participants: 3

Read full topic

Using the ChangeCounter

$
0
0

@nc284 wrote:

Hello all, this is a dumb question, but how would someone go about using the "ChangeCounter" attribute of a viewport. I'm trying to create a "fake" viewport in a separate window that changes whenever the active viewport changes. I see that there's a "ChangeCounter" that changes whenever a specific viewport changes, but how do I listen for this change? I figured I would do something similar to what this post is suggesting, in which I listen for a "property" to change and then trigger an action. But I don't really understand their code: http://stackoverflow.com/questions/5842339/how-to-trigger-event-when-a-variables-value-is-changed

The action that I would like is for an event to be triggered whenever a user stops moving the camera in the active viewport. but I don't know how to 'listen' for the change counter.

Posts: 3

Participants: 2

Read full topic


Get curve maximum curvature points

$
0
0

@henrydm wrote:

Hello,

Anyone know how to get the points of maximum curvature for a curve? I can get the inflection points by making the angle diff between tangents, and next iterate the segments to get the max curvature for each segment but it doesn't seem to be the most efficient technique.

Thanks and regards

Posts: 3

Participants: 2

Read full topic

Scriptable PDF Export

$
0
0

@MartinIC wrote:

Hi everyone,
I’m really in need for a scriptable PDF Export.

So far everything I’ve tried is not really working.
I got it all automated up until the point where the Dialog of the PDF Printer (Cute PDF I believe) pops up and I need to klick “OK” to save the file.

I can only set the PDF file name, by saving the Rhino File beforehand under that name, since the PDF File will be named according to the file name (Even though it would make more sense in cases of several layouts to name the file according to the layout.) – So I got my workaround for the file name.
But - Changing the paper size during PDF creation is not really working, since PDF export doesn’t take the Rhino layout size, but the last defined Paper Size.

I need to create PDF plans out of around 1000 Rhino Files each with between 12-27 Layouts in varying Paper formats.
It would be great to somehow get around clicking the OK button 12.000 to 27.000 Times and having to filter for Paper Formats before Export (Export all A0 Plans – change the Paper Size in the PDF Printer – Export all A1 Plans – change Paper Size in PDF Printer ,….)

Does anyone have any suggestions to solve the Problem? (Except hiring an intern for the Job :wink: )

Thanks,
Martin

Posts: 6

Participants: 4

Read full topic

Excuse me, what is the principle of interpolated curve?

$
0
0

@dragonforce wrote:

I want to make a closed interpolated curve based on four points.
But i don't know how the Rhino generated the curve, because with 4 points a infinite number of curves can be generated.
I'd like to ask, what is the principle of interpolated curve in Rhino (Grasshopper), is there any formula?
Please explain in detail, thank you very much!

Posts: 9

Participants: 3

Read full topic

Plugin with Toolbar - Rhino installer package issues

$
0
0

@tree wrote:

Hello,

I've produced a rhino installer (RHI) file that installs a plug-in. I have also included a custom tool bar in the installer.

The installer seems to work correctly however the installer does not make the tool bar available to the user - for instance, the tool bar does not appear as a tool bar, nor is it available for being made visible in the normal "show toolbar" method.

The RHI package is structured this way, per the instructions listed [ here ]:

NamePlugin\
.Rhino 5.0\
..x86\
...NamePlugin.rhp
..x64\
...NamePlugin.rhp
.Common\
..NamePlugin.rui

Notes:

  • I am using the current release of Rhino 5 to produce the RUI file.
  • The plugin works faultlessly after install.
  • The RUI was built correctly and have tested it by loading it manually - users just cant access it via the installer.

Posts: 10

Participants: 2

Read full topic

How to get textures settings from code?

"GenerateResource" task failed unexpectedly

$
0
0

@nc284 wrote:

Hi discourse,

I'm having a simple problem but I can't seem to get around it. I'm trying to build one of my projects on another computer, and I'm pretty sure I've set up all of my Visual Studio settings to match what I had on my other computer but I keep getting the error: "the 'GenerateResource' task failed unexpectedly..."

I tried following the tutorial for creating my first plugin in visual studio on windows, and I easily got that project to work by following directions however, I can't seem to build this project that I've copied over from another computer. I've changed the path that looks for the external application to run, and I've located the rhinocommon.dll on this computer.

When I run the plugin I copied over, Rhino opens, and I can type in my plugin name, and it will launch, however, any changes I make to the code aren't affecting the .rhp. I then tried deleting my .rhp, and building the plugin, and no new .rhp gets generated.

Any help would be greatly appreciated. Thank you.

-Nick

Posts: 3

Participants: 2

Read full topic

SampleNewFloatingViewport problem, C++

$
0
0

@BlueLeopard543 wrote:

Hi,

I would really appreciate your help on this.

(https://github.com/mcneel/Rhino5Samples_CPP/blob/22c79aab84540439c0b78f1c2a146fdce75f467d/SampleCommands/cmdSampleNewFloatingViewport.cpp)

I got the SampleNewFloatingViewport implemented in my comand, in my C++ plugin. When I launch the comand, sometimes the ending result isn't correct, and I end up with a Viewport newly created, but that wasn't renamed properly.

The only thing that I changed was saving the currentContext.m_doc in a CRhinoDoc* pointer, called currentDoc, and removing the view->FloatRhinoView(true), because I don't need it:

CRhinoView* RhinoViewsManager::createNewView(ON_wString viewName)
{
    ON_SimpleArray<ON_UUID> viewport_ids;
    ON_SimpleArray<CRhinoView*> view_list;
    CRhinoView* view = 0;
    int i = 0;

    // Build a list of (current) viewport ids
    currentDoc->GetViewList( view_list, true, false );
    for( i = 0; i < view_list.Count(); i++ )
    {
        CRhinoView* view = view_list[i];
        if( view )
            viewport_ids.Append( view->ActiveViewportID() );
    }
    view_list.Empty();

    // Create a new view
    currentDoc->NewView( ON_3dmView() );

    // Find the viewport (id) that was just created
    currentDoc->GetViewList( view_list, true, false );
    for(int i = 0; i < view_list.Count(); i++ )
    {
        view = view_list[i];
        if( view )
        {
            int rc = viewport_ids.Search( view->ActiveViewportID() );
            if( rc < 0 )
                break;
            else
                view = 0;
        }
    }

    // Make the necessary updates.
    if( view )
    {
        ON_3dmView v = view->ActiveViewport().View();
        v.m_name = (viewName);
        view->ActiveViewport().SetView( v );
        view->Redraw();
    }

    return view;
}

As I said, sometimes the program doesn't update the view name, probably because it doesn't enter in the "if(view)" block. Is that possible?

Plus, another question, is it permissible to save the currentContext.m_doc pointer as I did, or it is a thing that absolutely must not be done? (because it changes too much?)

Thank you for your help

Posts: 3

Participants: 2

Read full topic


Shutlining from c#

$
0
0

@denis_zk wrote:

How to apply shutlining to curves generated by c# command ? Maybe some attributes or custom user data can do this.
Certainly, i can use ApplyShutlining command, but i want do it programmaticaly.

Posts: 3

Participants: 3

Read full topic

Headless Rhino

$
0
0

@menno wrote:

For batch processing, I was wondering if Rhino can be started in headless mode, i.e. as a command-line program, not showing any GUI.

Posts: 5

Participants: 4

Read full topic

Select points between closed Curves

$
0
0

@jordy1989 wrote:

Hello,

I want to select the control points between the 2 projected crvs:


SelBoundary will always select all.
It should be able to script or vb.NET.

Is this possible? If so. Where do I start?

Posts: 4

Participants: 2

Read full topic

RunCommand c++ sdk giving paramters as vector or matrix

$
0
0

@kasper_steenstrup wrote:

I am prototyping a lot in rhino python but have decided to used c++ sdk for the more slow algorithm.

This means that I need to move data like [1,2,3,4,5,6,7,8............334] from my script to the c++ plugin.

How I do it now:

# Python
L = [1,2]
success = rs.Command("_-MyProgram %f %f  _Enter" % (L[0], L[1]))

// C++ inside MyProgram 
std::vector<double> data;
CRhinoGetNumber gd;
for(int i = 0; i <2; ++i){
    gd.SetCommandPrompt(":");
gd.GetNumber();
data.push_back(gd.Number());
}

If insted of having a list of 2 element had a list of 200 element: then I could fixt it easy by looping or creating a string and parsing it after words, but there will still be CommandPrompt 200 times and it just seem wrong.

Are there other ways of doing this:

best regards kasper

Posts: 3

Participants: 2

Read full topic

Python, looping object guid

$
0
0

@Maxence wrote:

Hello !
I'm completely new into scripting, and I am trying to scale every polysurface of a rhino project from its centroid.
So far, I managed to get this:

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select a polysurface", rs.filter.polysurface)

if obj:

    massprop = rs.SurfaceAreaCentroid(obj)

    if massprop: centroid = rs.AddPoint( massprop[0] )

    center3d = rs.PointCoordinates(centroid)

    rs.ScaleObject(obj, center3d, [0.9,0.9,0.9] )

As I said, I'm completely new. Now I'm trying to apply this scale to every polysurface of the file. And loops seam as a foreign language to me. If I manage to have a list with every guid of the polysurfaces, who do you I apply a transformation to each ?

Thank you.

(Sorry for my bad english.)

Posts: 3

Participants: 2

Read full topic

Viewing all 8547 articles
Browse latest View live