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

GetLine returns Tupple to World coordinates

$
0
0

@onrender wrote:

Hi,

I have just realized that GetLine method returns World coordinates of two points. It makes sense however I just moved the CPlane and spend some time I realized its behaviour. I think it would be useful to include it in the documentation that points are according to the World coordinates and not the actual CPlane.

By the way I started building a script but something is not working properly. The XFormWorldtoCPlane does not translate.

profile CPlane.3dm (25.7 KB)

import Rhino
import rhinoscriptsyntax as rs
import time

world = rs.PlaneFromFrame( [0,0,0], [1,0,0], [0,1,0] )
rs.ViewCPlane (None, world)
# curve = rs.GetObject("Select the path", filter=4 )
# rs.SetUserText (curve, "Name", "route01", False)
profile = rs.GetObject ("Select profile",0,False,False,None,False)
plane = rs.CurvePlane (profile, segment_index=-1)
plane0 = rs.ViewCPlane (None, plane)
startX = rs.GetLine(mode=0, point=None, message1="X Axis of the profile", message2=None, message3=None)
print startX[0]
print startX[1]
point1 = rs.AddPoint(startX[0])
point2 = rs.AddPoint(startX[1])
point1 = rs.XformWorldToCPlane (startX[0], plane0)
point2 = rs.XformWorldToCPlane (startX[1], plane0)
print point1
print point2

Posts: 2

Participants: 2

Read full topic


Can I control 'Feedback Mode'?

$
0
0

@nathancoatney wrote:

The display conduit doc page says:

  1. DrawOverlay : If Rhino is in a feedback mode, the draw overlay call lets temporary geometry be drawn on top of everything in the scene. This is similar to the dynamic draw routine that occurs with custom get point.

Can I turn on some sort of feedback mode (without using a Get()), so DrawOverlay updates without adding to the doc?

Thanks.

Posts: 2

Participants: 1

Read full topic

Is it possible to control the display on / off option using the API? [python]

$
0
0

@tr1004sm wrote:

image

Hello Please let me know if there is an API that can control the check / uncheck of Clipping Plane in Display mode as shown above. I would appreciate it if you could show me an example too.

Posts: 2

Participants: 2

Read full topic

Access rhinoCommon property from object existing in rhinoscriptsyntax

$
0
0

@timcastelijn wrote:

Hi,

I have a very extensive script in rhinoscriptsyntax. I’d like to acces a rhinoCommon property from an object existing in rhinoscriptsyntax (e.g. justification, see script below). Is there a way to achieve this without using Selection methods? e.g. via GUID?

thanks,
Tim

for obj in textobjects:
    # select the object in rhinoscriptsyntax
    rs.UnselectAllObjects()
    rs.SelectObject(obj)
    
    # get the new object reference in rhinoCommon
    rc, objref = Rhino.Input.RhinoGet.GetOneObject("Select text", False, Rhino.DocObjects.ObjectType.Annotation)
    if rc!=Rhino.Commands.Result.Success: return
    
    # display the property for test purposes
    justification = objref.Object().TextGeometry.Justification
    rs.MessageBox(justification)

Posts: 1

Participants: 1

Read full topic

Eto.Forms.TreeGridView python example?

TextEntity.GetBoundingBox() returns incorrect BoundingBox

$
0
0

@Matthieu_from_NAVINN wrote:

Hi,
This bug was supposed to be fixed since rhino6 SR8, but I still have the issue with Rhino6 SR9:
https://mcneel.myjetbrains.com/youtrack/issue/RH-44507

Set up a TextEntity with, or without a dimstyle with a TextHeight other than 1 and try to get the BoundingBox via .GetBoundingBox(). The result will be a bounding box with a height of 1.

Also, that is not only the text’s height that is wrong, but also the text’s alignement:
image

Posts: 1

Participants: 1

Read full topic

Setting the active view with Python

$
0
0

@yuvkah wrote:

Hi all,

I apologize in advance if this is a newbie question. I was trying (without much success) to set the active view automatically with python, so that when I use python to render it will always get the specific view I would like to render first, and only then run the render command.

I have found this:

But this only lets the user set the active view by CLICKING on it in the command line, while i would like to SPECIFY the view name IN THE CODE, so that when I run the code it will automatically change to that view. In pseudo code:

good_view=some_saved_view
Set_Active_View(good_view)
Render_Active_View

Does anybody have any useful insight regarding this?

Thanks in advance,

Yuval.

Posts: 2

Participants: 2

Read full topic

Rhinocommon bake objects in different layers but the same group

$
0
0

@Petras_Vestartas wrote:

Hi,

I would like to ask if it is possible to bake objects to rhino different layers but at the same time in the same group?

Currently I know that it is possible to add objects with attributes like this:
Rhino. Rhino Doc. Active Doc. Objects. AddSomeGeotype(geo, attributes)

Let say I have a point and a line, each of them are added to layer ‘points’ ‘lines’ but in rhino they stay as one group.

Manually I can group baked objects but no idea if it is possible to group while baking several objects in distinct layers.

Posts: 2

Participants: 2

Read full topic


Rhino Skin Issue

$
0
0

@josep_rexach wrote:

Hello Everbody,
Recently this problem appeared to load our Rhino Plug-In in Windows with non-English language,
It seems an issue with a FontFamily,
Applying this method is not effective for us…

Start > Control Panel > Administrative Tools > Services (or type services.msc from the Run command box).
Stop the Windows Presentation Foundation Font Cache 3.0.0.0 service.
Delete the cache file: FontCache3.0.0.0.dat
WinXP: C:\Documents and Settings\LocalService\Local Settings\Application Data
Vista/Win7: C:\Windows\ServiceProfiles\LocalService\AppData\Local
Restart the service or reboot the computer.

Do you know any news about this issue?

Thank you very much for your attention

Josep Rexach

System.Windows.Threading.Dispatcher.CurrentDispatcher.UnhandledException

SENDER: System.Windows.Threading.Dispatcher

EXCEPTION: System.NullReferenceException
MESSAGE: Object reference not set to an instance of an object.
SOURCE: “PresentationCore”
CALL STACK
at System.Windows.Media.FontFamily.LookupFontFamilyAndFace(CanonicalFontFamilyReference canonicalFamilyReference, FontStyle& style, FontWeight& weight, FontStretch& stretch)
at System.Windows.Media.FontFamily.FindFirstFontFamilyAndFace(FontStyle& style, FontWeight& weight, FontStretch& stretch)
at System.Windows.Media.Typeface.ConstructCachedTypeface()
at System.Windows.Media.Typeface.get_CachedTypeface()
at System.Windows.Media.Typeface.CheckFastPathNominalGlyphs(CharacterBufferRange charBufferRange, Double emSize, Single pixelsPerDip, Double scalingFactor, Double widthMax, Boolean keepAWord, Boolean numberSubstitution, CultureInfo cultureInfo, TextFormattingMode textFormattingMode, Boolean isSideways, Boolean breakOnTabs, Int32& stringLengthFit)
at MS.Internal.TextFormatting.SimpleRun.CreateSimpleTextRun(CharacterBufferRange charBufferRange, TextRun textRun, TextFormatterImp formatter, Int32 widthLeft, Boolean emergencyWrap, Boolean breakOnTabs, Double pixelsPerDip)
at MS.Internal.TextFormatting.SimpleRun.Create(FormatSettings settings, CharacterBufferRange charString, TextRun textRun, Int32 cp, Int32 cpFirst, Int32 runLength, Int32 widthLeft, Int32 idealRunOffsetUnRounded, Double pixelsPerDip)
at MS.Internal.TextFormatting.SimpleTextLine.Create(FormatSettings settings, Int32 cpFirst, Int32 paragraphWidth, Double pixelsPerDip)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLineInternal(TextSource textSource, Int32 firstCharIndex, Int32 lineLength, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
at MS.Internal.TextFormatting.TextFormatterImp.FormatLine(TextSource textSource, Int32 firstCharIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak, TextRunCache textRunCache)
at System.Windows.Controls.TextBlock.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.AccessText.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.WpfFrameworkElement3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:line 109
at Eto.Wpf.Forms.Controls.EtoLabel.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\Controls\LabelHandler.cs:line 23
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.EtoGrid.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\TableLayoutHandler.cs:line 16
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.WpfFrameworkElement3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:line 109
at Eto.Wpf.Forms.WpfContainer3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfContainer.cs:line 47
at Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:line 24
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.WpfFrameworkElement3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:line 109
at Eto.Wpf.Forms.WpfContainer3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfContainer.cs:line 47
at Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:line 24
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.WpfFrameworkElement3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:line 109
at Eto.Wpf.Forms.WpfContainer3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfContainer.cs:line 47
at Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:line 24
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.Controls.ScrollableHandler.EtoScrollViewer.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\Controls\ScrollableHandler.cs:line 31
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at Eto.Wpf.Forms.WpfFrameworkElement3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfFrameworkElement.cs:line 109
at Eto.Wpf.Forms.WpfContainer3.MeasureOverride(Size constraint, Func2 measure) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfContainer.cs:line 47
at Eto.Wpf.Forms.EtoBorder.MeasureOverride(Size constraint) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\EtoBorder.cs:line 24
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Window.MeasureOverrideHelper(Size constraint)
at System.Windows.Window.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_SizeToContent(SizeToContent value)
at System.Windows.Window._OnSizeToContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.Window.set_SizeToContent(SizeToContent value)
at Eto.Wpf.Forms.WpfWindow`3.b__23_0(Object , RoutedEventArgs ) in D:\BuildAgent\work\commercial\src4\DotNetSDK\Eto\src\Eto.Wpf\Forms\WpfWindow.cs:line 84
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Interop.HwndTarget.OnResize()
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHa

Posts: 1

Participants: 1

Read full topic

Rhino.Display.ZBufferCapture class usage

$
0
0

@gstoilov wrote:

Hi,
I tried to build Z-depth map of a view and to export floating point data to a binary file.
I am using Rhinocommon and c# for the project.
A part of the code for illustration is:

Rhino.Display.ZBufferCapture zb = new Rhino.Display.ZBufferCapture(viewport);
Single[] sa = new Single[xsize * ysize];

sa[iy*xsize + ix] = zb.ZValueAt(ix, iy);

It works fine but there are two problems:

  1. Data from ZValueAt() is scaled to 0.0…1.0 and can’t be compared to other exports even at the same object in different view (camera) position.
  2. Even the view size can be set to arbitrary value (for example 4000x4000) only the area of the screen (in case of HD screen approximately 1920x1080) is filled with a data.
    I can’t find any example and documentation about usage of Rhino.Display.ZBufferCapture class.

Does anybody have experience with it?
Thank you in advance

Posts: 1

Participants: 1

Read full topic

Fastest way to know the object's groups

$
0
0

@gennaro wrote:

Hi all,

do you know, given an object, which is the fastest way to get the groups it belongs to?

G.

Posts: 2

Participants: 2

Read full topic

WPF Constructor Crash

$
0
0

@jeremy.graham86 wrote:

Hi,

Up until a minute ago, i have been working on a WPF plugin which has been working fine. After changing some minor code in a display conduit, i now can’t open Rhino as it crashes on debug as shown in the image below.

Any suggestions on why this would suddenly start happening?

Posts: 2

Participants: 1

Read full topic

C# The object cannot be modified because it is controlled by a document

$
0
0

@marcocaneve wrote:

Hi, i’ve written the following script inside a grasshopper “C# Script” component.

But sometimes it gives this error: "The object cannot be modified because it is controlled by a document"

I not understand why this exception is thrown since my script does not modify any property of the layer.

This error does not appear every time and I’m not able to find a way to reproduce it.
The only way to solve is to restart rhino.

I’m using Grasshopper over a rhino worksession with some files attached.

Any ideas?

private void RunScript(ref object A)
{
   List<string> layerList = new List<string>();

   RhinoDoc doc = Rhino.RhinoDoc.ActiveDoc;
   foreach(Layer l in doc.Layers)
   {
       if(!l.IsDeleted)
       {
          layerList.Add(l.FullPath);
       }
   }
   A  = layerList;
}

Posts: 1

Participants: 1

Read full topic

Developer docs - C#, VB, Python tabs for example code

$
0
0

@Helvetosaur wrote:

Hi,
This is a minor niggle, but on the example pages, why is the Python tab separated (at the bottom of the page) from the C# / VB tabs which are together? I know Python was added later, but it has been around for a long time now and the developer docs site has been completely redone since then…

image
image

Posts: 1

Participants: 1

Read full topic

Plugin won't install or gives grasshopper error Cannot create more than one System.Windows.Application instance in the same AppDomain

$
0
0

@pekko.kuula wrote:

Hi!

I wanted to create a Rhino6 plugin that shows a “Splashscreen” before Rhino starts. The Idea is to choose which crasshopper plugins are active and copy and delete some .ghlink files based on that. Also, it runs an update script when rhino closes. I used your “My first C# plugin” -tutorial.

Here is my plugin code. The form is an eto form made by me. I know, the solution is pretty hacky. I’d be happy to hear about better solutions to run code at startup and at end.

public class SplashScreen : Rhino.PlugIns.PlugIn
{
    public SplashScreen()
        Instance = this;
        new Eto.Forms.Application().Run(new RoleSelectionForm());

        RhinoApp.Closing += (sender, args) =>
        {


            string path =
                Path.Combine(RoleManager.GrasshopperUserDataPath, "EnvironmentTools",
                    "Update.bat");
            try
            {
                Process.Start(path);
            }
            catch (Exception e)
            {
                // Pokémon!!
                Console.WriteLine(e);
                throw;
            }
        };

    }

    ///<summary>Gets the only instance of the SwecoSplashScreen plug-in.</summary>
    public static SplashScreen Instance
    {
        get; private set;
    }

    // You can override methods here to change the plug-in behavior on
    // loading and shut down, add options pages to the Rhino _Option command
    // and maintain plug-in wide options in a document.

    public override PlugInLoadTime LoadTime => PlugInLoadTime.AtStartup;
}

On some machines this works fine, but some machines have problems.

-On another coworker’s machine the plugin displays the splashscreen, but when he opens grasshopper he gets lots of errors of type:

Object: Component_AnalyzeThI_GUI_new (level 1)
{
  Exception has been thrown by the target of an invocation.
  TargetInvocationException
}

Object: Component_AnalyzeThI_GUI_new (level 2)
{
  Cannot create more than one System.Windows.Application instance in the same AppDomain.
  InvalidOperationException
}

Object: Component_CroSec_JointAgent (level 1)
{
  Exception has been thrown by the target of an invocation.
  TargetInvocationException
}

Object: Component_CroSec_JointAgent (level 2)
{
  Cannot create more than one System.Windows.Application instance in the same AppDomain.
  InvalidOperationException
}

Object: Component_CroSec_Joint (level 1)
{
  Exception has been thrown by the target of an invocation.
  TargetInvocationException
}

{

-One coworker couldn’t install the plugin at all. Whenever he tries to open the .rhi, or drag the .rhp into Rhino6, Rhino5 opens, tries to installa the plugin and tells that the plugin is not supported. I have made the plugin for Rhino 6, and we both have and Rhino5 and Rhino6 v6.8.18240 installed. Using Rhino 6 plugin manager gives the error “File came to another computer and has been blocked”. Your instructions for unblocking the file don’t work, since the file isn’t blocked. https://wiki.mcneel.com/rhino/unblockplugin

Posts: 2

Participants: 2

Read full topic


Enable DisplayConduit after Rhino Is Open (C++)

$
0
0

@pythonuser wrote:

Hi;
In this sample,if I want to enable the displayconduit when the PlugIn load,and the it draw the mesh after mesh get a value by CRhinoGetObject.

How cant I do this, is it some sample?

Posts: 3

Participants: 2

Read full topic

Disable mouse right click repeat

Dockbar not created (Rhino 6, C++ sdk)

$
0
0

@gundersen wrote:

Hello! I am porting our plugin from Rhino5 to Rhino6. While porting dockbar functionality, I found out that I cannot create it and do not know why. Basically, I got NULL pointer when I call dockbar creation dialog and then soon Rhino crashes with call stack going somewhere to Rhino internals. I am creating dockbar as stated in samples:
m_pDockBar = ::RhinoUiDockBarManager().CreateRhinoDockBar(
RUNTIME_CLASS(CTreeDockBar), PlugInID(), false, AFX_IDW_DOCKBAR_RIGHT, CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT, NULL,
CBRS_TOOLTIPS | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_LEFT);

Sample application works fine, but when I have copied the sources of sample dockbar class and dockbardialog, an attempt of creating sampledockbar also results in NULL pointer. Which might help identifying the problem is that the sample application initialises dockbar when the command is called, while in our application the plugin is initialised with initialisation of Rhino.

What can be helpful: in the documentation I hae found that CreateDockBarControls should not return false otherwise I would get NULL; this function is never called in our code even though it is declared and overriden.

Can anyone point me out what could be wrong please?

Posts: 3

Participants: 2

Read full topic

CheckNewObjects command

$
0
0

@Willem wrote:

Hi,

Is there a way to script CheckNewObjects setting through python/rhinocommon?
Else I will have to revert to scripted commands

EDIT:
piggybacking my own question
how do we access Rhino-Options-Advanced items through RhinoCommon?
It could be a logical place to store the CheckNewObjects setting…

Thanks
-Willem

Posts: 1

Participants: 1

Read full topic

Add custom Point Object to doc

$
0
0

@lando.schumpich wrote:

Hello,
I have a question regarding the CustomPointObject Class.

Until now of the Custom Object Classes i have used mostly CustomCurveObject and been adding them to the rhinodoc with the AddRhinoObject(curveObject, curve) overload which seams to internally convert my customCurveObject to a curveObject.

Right now i’m scripting up a 2d Graph System with Nodes and for the Nodes customPointObjects seem more fitting. Adding customPointObjects to the Rhinodoc doesn’t work with AddRhinoObject(PointObject, Point), and adding just with AddRhinoObject(CustomPointObject) places all added PointObjects at the world origin.

What would be the recommended way of adding a customPointObject considering i don’'t really need a HistoryRecord for my functionality?

Many thanks,
Lando

Posts: 1

Participants: 1

Read full topic

Viewing all 8550 articles
Browse latest View live