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

Forcing Rhino to Load a Language Template

$
0
0

@Markus_Erhardt wrote:

Hi all,
I am develloping a pluging in Rhino with Vb6.
If the user an another language than the English version my plugin doesn’t work anymore.
I tried to find why and the response is based on the
Rhino.Command(“MyEnglishCommand”) . MyEnglishCommand is unrecognized because the template loaded in Rhino is different. How can I solve this problem?

Posts: 1

Participants: 1

Read full topic


Multiple intersection curves for closed polysurface

$
0
0

@Willem wrote:

Hi,

I run into an issue I did not have before, where the intersection between 2 breps creates 2 curves where only 1 is expected. I never ran into an issue with this before so maybe it’s introduced in one of the latest releases.


With the file and script it’s possible to reproduce the issue:

bad_intersect.3dm (127.5 KB)

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

tol = sc.doc.ModelAbsoluteTolerance

plane_brep = rs.coercebrep(rs.ObjectsByName('plane')[0])
part_brep = rs.coercebrep(rs.ObjectsByName('part')[0])

bln,section_curves,pts = Rhino.Geometry.Intersect.Intersection.BrepBrep(part_brep,plane_brep,tol)

print 'found {} sectioncurves '.format(len(section_curves))
_ = [sc.doc.Objects.AddCurve(c) for c in section_curves]

Thanks
-Willem

Posts: 1

Participants: 1

Read full topic

GH Component was build against a newer minor version

$
0
0

@gennaro wrote:

Hi everybody,

I have coded a GH Component and it is working fine in my computer. The problem is that in some others I get
gh
even if Rhino is fully updated.
How do I solve this problem?

Thanks

Posts: 2

Participants: 2

Read full topic

Create a GUI for rhino with Visual Studio

$
0
0

@javiervg84 wrote:

Hi,

I´m trying to create a GUI for rhino with VB. I can create plugin using rhinoscript in Visual Studio but I don´t have idea of how create GUI.

Can anyone help me?

Thank you.

Posts: 1

Participants: 1

Read full topic

How to work in session with rhinocommon

$
0
0

@Matthieu_from_NAVINN wrote:

Hi,
I’m trying to figure out how to work with sessions and RhinoCommon (RH6), but I haven’t found documentation on this subject. For example:

  • How do you know if you are in a worksession or just working with a rhino file?
  • How do you list the other files referenced in the work sessions?
  • In a work session, how do you know if a layer or an object belong to your active file or if it is just another external reference?

Is there any doc available out there?

Best regards
Matthieu

Posts: 3

Participants: 3

Read full topic

Use TrimBrep

$
0
0

@cua54kttt wrote:

Dim strObject, strCutter

strObject = Rhino.GetObject("Select surface or polysurface to trim")

If Not IsNull(strObject) Then

	strCutter = Rhino.GetObject("Select cutting surface or polysurface")

	If Not IsNull(strCutter) Then

		Rhino.TrimBrep strObject, strCutter

	End If

End If

It’s always trim in I don’t like. The same picture 2. But i want to cutting in " Want to trim" the same picture 1.
I don’t know about it. Please help me.2 1

Posts: 2

Participants: 2

Read full topic

Get point along a line, is the cursor actually close on left or close on the right of it?

$
0
0

@lscandella wrote:

Hello Forum,

I need to dynamically draw a hatch along a line. I’m using GetPoint and I’m enabling snapToCurve. By calling PointOnCurve the system gives me both the closest line, if any, and the line coordinate of the closest point with respect to the pointer position.

The hatch can be on the left or on the right of the line and I want to set this direction through the actual position of the pointer with respect of the snapped point.

How can I understand if the cursor is actually close on the left or close on the right of the line?

Thanks. L

Posts: 1

Participants: 1

Read full topic

Get intersect point between mesh with Ray (c++)

$
0
0

@suc_kiet wrote:

Hi;
In Rhinocommon I can use this funtion : Intersection.MeshRay Method (Mesh, Ray3d,Int32[]), find the faces which intersect with the Ray, but I search the Rhino c++ sdk along time, I was not found the funtion like it, how cant I solve it?

Posts: 1

Participants: 1

Read full topic


rhinoscriptsyntax.TextOut does not return itterable

$
0
0

@Willem wrote:

Hi,

Rhino.UI.Dialogs.ShowTextDialog() does not return an itterable so the TextOut method throws an error.

image

-Willem

Posts: 1

Participants: 1

Read full topic

Is there a way to create own class which inherits GeometryBase

$
0
0

@D-W wrote:

As i see all internals are sealed. Did anyone tried to do this and create custom geometry class?

Posts: 1

Participants: 1

Read full topic

Instance reference serialization

$
0
0

@serdem wrote:

Hello,

I want to serialize instance references which consists of curves and hatches.
Is it possible to serialize instance reference?

Thanks

Posts: 1

Participants: 1

Read full topic

Why doesn´t work GetScriptObject in this plug-in?

$
0
0

@javiervg84 wrote:

This plug-in works properly until the command Rhino.islayervisible(strLayer). Anyone know why could be this? I am developing this plug-in with VB in Visual Studio 2015.

You can see my program below:

Imports System
Imports System.Collections.Generic
Imports Rhino
Imports Rhino.Commands
Imports Rhino.DocObjects
Imports Rhino.Geometry
Imports Rhino.Input
Imports Rhino.Input.Custom

Namespace ACTIVAR_CAPAS

<System.Runtime.InteropServices.Guid("c1135058-446c-4002-bae0-3aa90b39e42b"),
Rhino.Commands.CommandStyle(Rhino.Commands.Style.ScriptRunner)>
Public Class INCOMACTIVARCAPASCommand
    Inherits Rhino.Commands.Command

    Shared _instance As INCOMACTIVARCAPASCommand


    '''<returns>The command name as it appears on the Rhino command line.</returns>
    Public Overrides ReadOnly Property EnglishName() As String
        Get
            Return "INCOMACTIVARCAPAS"
        End Get
    End Property

    Protected Overrides Function RunCommand(ByVal doc As RhinoDoc, ByVal mode As RunMode) As Result
        Dim Rhino, objRhinoScript As Object


        objRhinoScript = CreateObject("Rhino5x64.Interface")
        If (Err.Number <> 0) Then
            RhinoApp.WriteLine("Unable to create Rhino5x64.Interface object")
            Exit Function
        End If


        Rhino = objRhinoScript.GetScriptObject

        If (Rhino Is Nothing) Then
            RhinoApp.WriteLine("Failed to get Rhinoscript object")
            Exit Function
        Else
            RhinoApp.WriteLine("Rhino object created.")


        End If

        Dim arrLayers As Array
        Dim strLayer As String


        arrLayers = Rhino.LayerNames

        If IsArray(arrLayers) Then

            For Each strLayer In arrLayers

                If Rhino.islayervisible(strLayer) = False Then

                    Rhino.layervisible(strLayer, True)

                End If



            Next

        End If

        Rhino = Nothing

        objRhinoScript = Nothing

        Return Result.Success


    End Function
End Class

End Namespace

Posts: 1

Participants: 1

Read full topic

How to gain access to the RhinoScript object from Visual Basic?

$
0
0

@javiervg84 wrote:

I´d like to know how gain access to the rhinoscript object to be able to execute command as Rhino.print(), rhino.textobjecttext(),rhino.layervisible() in my plug-in created with visual studio.

Thank you in advance

Posts: 1

Participants: 1

Read full topic

Rhino Installer Engine

How to get all mesh faces which share one vertex (c++)


C++ select by name

Rhino 4 - Point on mesh

$
0
0

@OveJo wrote:

Hi,

I have some customers that still uses Rhino 4, and I now need a plugin for Rhino 4 that projects point on mesh.
Can anyone help me?
Should be the same as this for Rhino 5:

       ObjRef Mesh_ref;
        var rc = RhinoGet.GetOneObject("Select the mesh", false, ObjectType.Mesh, out Mesh_ref);
        if (rc != Result.Success) return rc;
        ObjRef obj_ref = Mesh_ref;
        var mesh = obj_ref.Mesh();

        var gp = new GetPoint();
        gp.SetCommandPrompt("Set first point");
        gp.Get();
        if (gp.CommandResult() != Result.Success)
            return gp.CommandResult();
        var set_point = gp.Point();

        Point3d pt1a = new Point3d(set_point.X, set_point.Y, set_point.Z);

        gp = new GetPoint();
        gp.SetCommandPrompt("Set second point");
        gp.Get();
        if (gp.CommandResult() != Result.Success)
            return gp.CommandResult();
        set_point = gp.Point();

        Point3d pt2a = new Point3d(set_point.X, set_point.Y, set_point.Z);

        gp = new GetPoint();
        gp.SetCommandPrompt("Set third point");
        gp.Get();
        if (gp.CommandResult() != Result.Success)
            return gp.CommandResult();
        set_point = gp.Point();

        Point3d pt3a = new Point3d(set_point.X, set_point.Y, set_point.Z);

        var points = new List<Point3d>();
        points.Add(pt1a);
        points.Add(pt2a);
        points.Add(pt3a);


        int[] indices;

        var prj_points = Intersection.ProjectPointsToMeshesEx(new[] { mesh }, points, new Vector3d(0, 0, 1), 0, out indices);

        foreach (var prj_pt in prj_points) doc.Objects.AddPoint(prj_pt);
        doc.Views.Redraw();

Posts: 2

Participants: 2

Read full topic

EtoCollapsibleSection crashes Rhino

$
0
0

@tom_svilans wrote:

Hi,

Came across this weird issue today…

I’ve been following the examples on Github (specifically, https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsCustomRenderSettingsSections) and copypasting the render settings section classes to my own plug-in.

It seems that either the newer versions of Rhino don’t like the example, or I am missing something very obvious. I’ve trimmed down the problem to RenderSettingsCustomSections(List<ICollapsibleSection> sections) and when my custom section gets added. The snippet from the plug-in class looks like this:

    private CustomRenderSettingsSection m_render_section;
    
    public CustomPlugIn()
    {
        if (Instance == null) Instance = this;
        m_render_section = new CustomRenderSettingsSection();
    }

    public override void RenderSettingsCustomSections(List<ICollapsibleSection> sections)
    {
        sections.Add(m_render_section);
        //base.RenderSettingsCustomSections(sections);
    }

Commenting out sections.Add(m_render_section); makes it work.

The problem appears when I attempt to turn on the Rendering panel in Rhino, when my custom render plug-in is active. Rhino freezes and eventually crashes.

I’ve pared down the CustomRenderSettingsSection class to the minimum, meaning getting rid of all the event handlers and usage of the CustomRenderSettingsViewModel, to try to narrow down the problem.

CustomRenderSettingsSection inherits from EtoCollapsibleSection and combines CustomSection and CustomRenderSettingsSection from the Github example.

Does it need the ViewModel class in order to work?

Much thanks,

Tom

Posts: 2

Participants: 1

Read full topic

Cannot register assembly

$
0
0

@D-W wrote:

@dale @stevebaer @pascal I try do do interop on my own but i get such message. For sure im doing something wrong …

RegAsm : error RA0000 : Cannot load file 'RhinoCommon, Version=5.1.30000.17, Culture=neutral, PublicKeyToken=552281e97c755530' or one of its dependencies.

In this case what should create? C++ native -> c# raw dll lib(which i reference in plug) -> plugin rhp ?

Posts: 3

Participants: 2

Read full topic

Changing the Units and Scaling when reading a RhinoFile

$
0
0

@Miguel wrote:

Hi,
I am reading a Rhino file with Rhino.FileIO I’ve changed the units of the file but I also wanted that the geometry scales accordingly. Do I need to scale every object in the file or is there a nicer way of achieving this?

Best,

Posts: 1

Participants: 1

Read full topic

Viewing all 8556 articles
Browse latest View live