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

Selecting a point3D in the model among a list

$
0
0

@Matthieu_from_NAVINN wrote:

Hi,

I've got a list of point3D in my model, I would like the user to choose one among them in the model. I'm using vb.net with rhinocommon.

I tried to look at the constraints or snaps of "getpoint" but I don't get how to do this.

Thanks for your help!

Posts: 8

Participants: 3

Read full topic


DrawtoBitmap with my own created RhinoViewport - c# RhinoCommon

$
0
0

@namarcin wrote:

Hi,
It's possible to draw own created RhinoViewport with DisplayPipeline.DrawToBitmap method to Bitmap?
With standard Rhino Viewports DrawToBitmap works perfect, but when I create my own viewport then DrawToBitmap return null bitmap.

RhinoViewport rviewport = new RhinoViewport();
Bitmap vportBitmap = DisplayPipeline.DrawToBitmap(rviewport,200,200);

Posts: 3

Participants: 2

Read full topic

Possible to get syntax highlighting in Atom help window?

RhinoCommon API with Comment function via.hypothes.is

How to auto search all object

$
0
0

@jerry1 wrote:

Hi, I have some information save in Rhino.Geometry.TextEntity, and finally I save to 3dm file, and when I re-read this 3dm, then I open my plugin program, I need to auto search my TextEntity, and How to do? I don't like select by handwork. thanks

Posts: 2

Participants: 2

Read full topic

Undo/Redo inisde command (Rhinocommon c#)

$
0
0

@namarcin wrote:

Hi,
its possible to implement Undo/Redo feature inside command. For example, in class Rhino.Input.Custom.GetPoint, when I get a lot of points in the loop, I wanna to implement undo/redo for single point. Just as in the Polyline command in Rhino.

Thanks for help.

Posts: 5

Participants: 2

Read full topic

Replace an array of point objects [C++]

$
0
0

@pagarcia wrote:

Hello all,

In my plugin I add a set of point objects like this

CRhinoPointObject** point_object_array = new CRhinoPointObject*[4];

for (int i = 0; i < 4; i++) {
	point_object_array[i] = new CRhinoPointObject();
	point_object_array[i]->SetPoint( array[i] );
	context.m_doc.AddObject(point_object_array[i]);
}

Note that array is an ON_3dPointArray of size 4. After some changes (of array, and attributes) I need to replace it, trying this

CRhinoPointObject** new_point_object_array = new CRhinoPointObject*[4];

for (int i = 0; i < 4; i++) {
	new_point_object_array[i] = new CRhinoPointObject();
	new_point_object_array[i]->SetPoint( array[i] );
	context.m_doc.ReplaceObject(point_object_array[i], new_point_object_array[i]);
}
context.m_doc.Redraw();

but it doesn't work... Maybe because of the **pointer? Is there a workaround for this?

Many thanks!

Pablo

Posts: 5

Participants: 2

Read full topic

RhinoCommon - Select / Highlight SubObject

$
0
0

@Tom_ wrote:

How to select SubObjects ?

http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_RhinoObject_SelectSubObject.htm

let s say i have a Brep ( closed Polysurface ) and i want to Feedback a selected Face to the user.
how to do this ?
what is missing ? what is wrong ? thanks for any help.

rhObj.HighlightSubObject(index, true);
rhObj.SelectSubObject(index, true, true);
rhObj.CommitChanges();
doc.Views.Redraw();

Posts: 2

Participants: 2

Read full topic


Force a command line parameter to a value

$
0
0

@lscandella wrote:

Hello Forum,

I'd like to force the "distance" parameter in the "offset" command-line command to a specific value. Is there a way to do it? I'm working under RhinoCommon

Thanks. L

Posts: 2

Participants: 2

Read full topic

How to import selected blocks from a File3dm? (Or were blocks saved incorrectly in this file?)

$
0
0

@jups23 wrote:

Aim

I want to programatically filter which blocks to import from a given file. As a particular example where it does not work see leg_caster.3dm (4.1 MB)
.

I was unsuccessful because File3dmObjects I can add via doc.InstanceDefinitionAdd() but in this file I cannot find them based on their block definition name scanning File3dm.Objects. InstanceDefinitionGeometry however, I can find with File3dm.InstanceDefinitions.Where() but doc.InstanceDefinitionAdd() called with the fund objects returns always -1.

Attempts

(1) In all of my files so far but one it works by filtering by the names of the objects via the RhinoCommon API because the object names correspond to the block definition names: File3dm.Objects.Select(x=>x.Name == "myName).
Yet, when I read the attached file in my RhinoCommons plugin with File3dm.Objects.toArray() I find the object names to be empty or "Rhinoceros Binary STL (Aug 29 106)" although the blocks are named "swivel caster", "chair leg" etc.

(2) However, when importing the file with the _-Import macro the block names gets added to my open file. But with this script macro I cannot selectively import blocks because the BlockManager is not yet scriptable on OS X (see this forum entry: https://discourse.mcneel.com/t/how-to-import-export-block-from-to-external-file-into-open-document/37234/15)

(3) I also tried to find the right instance definitions based on their name via File.InstanceDefinitions.

var blocks = file.InstanceDefinitions.Where((arg) ⇒ arg.Name == "caster"); // gives Rhino.Geometry.InstanceDefinitionGeometry, how can I get the Instance?
var geometries = new List<GeometryBase> {blocks.First()};
var definitionID = doc.InstanceDefinitions.Add(blocks.First().Name, "Description",
                                               Point3d.Origin,
                                               geometries);  // returns -1
doc.Objects.AddInstanceObject(definitionID, Tranform.Identity);

Is there a defect in the Rhino file API when writing this file? How can I repair my file? Or is there a better API to access the blocks and add them to my current document?

Setup

Xamarin Studio 6.1.2, .NET Mono 4.5
Rhinoceros for Mac 5.2.3

Posts: 2

Participants: 2

Read full topic

Rhino3 install .DLL Plugin

$
0
0

@Daniel_Bohn wrote:

There is a Rhino3 plugin wich is provided as a folder including following dlls:

-de [folder: contains MyPlugin.Ressorces]
-MyPlugin.dll
-Rhino3.dll
-Rhino3.DotNet.dll
-RhinoScript.dll

Rhino3s plugin-manager accepts only .rhp plugins to install. Rhino3-Net SDK is installed. I get allways attribute-error also for sample plugins from SDK when i try to install .dll with DotNetManager-Plugin?

This is just for testing and to get a basic feeling about it.
The actual task is is to rebuild this plugin for use with Rhino5 (Plugins C#-Source-Code is present)

Posts: 2

Participants: 2

Read full topic

Disable Rhino commands

$
0
0

@cristina.b wrote:

Hi,

How can we disable some commands(mostly geometry editing) while our Plug-in is running, to prevent messing up the parametric modelling that we provide through the plug-in?

Ideally we should disable all, and have a list of exceptions.

Thank you!

Cristina

Posts: 3

Participants: 3

Read full topic

Last modified objects

Multithreading with rhinocommon

$
0
0

@Matteoz991 wrote:

In multithreading, is it safe to use RhinoApp.MainApplicationWindow.Invoke(new Action(delegate { MyMethodWorkingWithRhinoDoc(parameters); })); to perform actions on rhino doc?

Posts: 1

Participants: 1

Read full topic

Lag with Excessive Surface Generations

$
0
0

@eebs99 wrote:

I've come to realize that when my plugin needs to generate a lot of surfaces (using methods like NetworkSurface or CreateThroughPoints), it starts to slow down after a couple iterations.

This lag is more visible when a more complicated surface is being created - sometimes if I wanted to generate about 30 highly complex surfaces, the plugin would create the first two within a minute but then it would gradually take longer to do the rest (I waited a whole day for this to finish).

After generation, each surface is added to a List, and the process repeats.

What is causing this increasing lag? How can I fix this?

Posts: 4

Participants: 2

Read full topic


Triangulate a mesh via RhinoCommon

Popup while multithreading (rhinocommon): "This action cannot be completed because the other program is busy."

$
0
0

@samlochner wrote:

I'm getting the below popup while trying to multithread in a rhinocommon plugin. Any thoughts on what might be causing it and how to correct it?

Thanks,
Sam

"This action cannot be completed because the other program is busy. Choose 'Switch To' to activate the busy program and correct the problem."

Posts: 1

Participants: 1

Read full topic

How to improve efficiency about split surface by curves?

$
0
0

@Vaker wrote:

Dear all,

I want to split surface by curves.


I using RhinoSplitBrepFace() to split.
It cost about 10 min.
I using "Split" command to split the same model.
It only cost about 5 sec.
How can I improve efficiency?

The model in the 3dm file.
SplitSrfTest.3dm (578.2 KB)

Kind regards,
Vaker

Posts: 1

Participants: 1

Read full topic

Rhino crashing while trying to open a 3dm file on idle event

$
0
0

@piac wrote:

Continuing the discussion from Multithreading with rhinocommon:

Posts: 9

Participants: 2

Read full topic

"Model space scale" in RhinoCommon

$
0
0

@TobyLai wrote:

I am trying to find out which is the property for Model space scale in DimensionStyle.

DimensionStyle has properties, TextHeight,TextGap ,ExtensionLineExtension ,ExtensionLineOffset, but I cannot find Model space scale.

Is this being stored in the DimensionStyle class or somewhere else?

Posts: 1

Participants: 1

Read full topic

Viewing all 8636 articles
Browse latest View live