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

Creating a GDL object for Archicad in Grasshopper

$
0
0

Hi,
(Please inform me if there is a better category for this question)

Creating a GDL object for Archicad in Grasshopper.
First question: Is it possible to make it?

Does anyone have any experience with this?

4 posts - 3 participants

Read full topic


Opensource Plugins

$
0
0

Are there some plugins same as HB&LB that is open source and we can access to their code in c# or python component?
Thanks for sharing your responses.

1 post - 1 participant

Read full topic

C#. Ways of improving calculation time of scripted components

$
0
0

Hi everyone,

I don´t have much of a background in scripting and have been slowly trying stuff out.

So here is my question, I have coded a component to iteratively subdivide a Mesh. The thing is that the resulting component is extremely slow. I know it is exponential in every iteration but still after 4 or 5 iterations it becomes practically unusable because it crashes when it really shouldn’t. I know that the way that I wrote is not the best so I am uploading it to see if anyone can give any suggestions as to how to improve its efficency and calculation time.

Thanks in advance.

Scripting in C.gh (7.2 KB)

5 posts - 3 participants

Read full topic

Mesh deform

$
0
0

Hi everyone, one question about grasshopper. How can i deform just one part of the sphere to inside, i’ve tried with spatial deform but i do not know how to use it. Some suggestions please.

3 posts - 2 participants

Read full topic

Tree Transparency database for modelling in Energy Simulaitons

$
0
0

Hi,
Im relatively new to energy modeling and I have a question regarding choosing the “tree canopy transparency” value.
Is there a database or is it assumed based on experience?
I would appreciate help regarding modeling trees for energy simulation too.

2 posts - 2 participants

Read full topic

Mesh offset intersecting triangles

Using of Expiresolution from Rhino AddObject Event

$
0
0

Hi,

I would like to have custom GH component updated after Rhino AddObject event is fired.
I tried to use ExpireSolution(True) however doesn’t seem to work.
Any hint?

Thanks,
Dmitriy

2 posts - 2 participants

Read full topic

Hole pattern on pre-defined shape with holes

$
0
0

Hi!

Newbie here!

I am trying to make a custom hole pattern on a pre-defined shape. This main shape has holes in various forms on it. In the attached image, you can see a reference of what I am trying to accomplish. Yellow area is my main shape, white spots are holes, dashed lines are the offset from these outlines. The hole pattern should be inside the orange area and should be following the dashed lines. Since my main shape and holes have different forms, how can I make a pattern that follows these outlines but also blend nicely between them? In short:

1 - How can I create a hole pattern (perforated) inside only the orange area? I like to control the distance between holes and also diameter of holes.
2 - How can these holes follow the dashed lines?
3 - How can these holes blend nicely in the areas between the dashed lines?

If anyone has any ideas on how to approach to this, I would greatly appreciate your help.

1 post - 1 participant

Read full topic


Changing Font on a List

$
0
0

Hi Guys, hope you are well in this period. I was used to the old Forum! :wink:

I would like to ask you one question about changing fonts on a list:

A
B

I had a list of Name, Surname and Address (image A) I would like to amend it and have a numeration and different fonts for each info (image b). Is there someone who did it or could help me to do it?

Maybe this is right:
FROM the beginning of the first word to - -> BOLD FONT
FROM - to -> BOLD ITALIC FONT
FROM ( to ) -> italic font
then do a numbered list

Thanks in advance! :wink:

1 post - 1 participant

Read full topic

Accessing ghenv from Python module

$
0
0

I have taken a bunch of code I use in multiple GH Python components and put them in a Python module I store in Plug-ins\IronPython\Lib. The code is organized into a number of classes, I can call the code from any GH Python component, everything works fine, with one exception. Ghenv is not defined, so I can’t call ghenv.Component.AddRuntimeMessage() from within the code. I’ve seen a number of posts referring to the need to replace ghenv.Component by self when using the SDK, but if I’m not mistaken that refers to Rhino 6, and even then would probably not work within my classes.
Is there anyway to reference ghenv from within this module, or do I need to send along ghenv or the component as a parameter when I instantiate the class?

1 post - 1 participant

Read full topic

PriorityLoad() not fireing on Rhino for Mac

$
0
0

Hello all

I’m using PriorityLoad() to load embeded resources. This works well on Windows, but on Mac the method won’t fire unless all assemblies are present in the same folder as the .gha. I’ve tried everything even building on Mac.
Are the assemblies loaded differently on Grasshopper for Mac? It seems they are loaded before my components are loaded for the first time not giving me a chance to serve it with PriorityLoad()?

1 post - 1 participant

Read full topic

Remove Item on DataTree,not the entire path, in C#

$
0
0

Hi all,

I can’t find a suiting methode for removing an item on a specific branch.

Am I missing something, how could I do it?

Thanks everybody!

19 posts - 3 participants

Read full topic

Component takes longer than expected

$
0
0

Hi all, @DavidRutten,

I’m blind again without knowing what’s going on under the hood. I have a component that encapsulates a particle solver and if I measure what it takes on my own it is much less than the actual time it takes in GH and that show up on the profiler.

My measurement shows:

Component took 69 ms.
  BeforeSolveInstance took 0 ms.
  SolveInstance took 68 ms.
    Inputs took 4 ms.
    Solve took 58 ms.
    Outputs took 5 ms.
  AfterSolveInstance took 0 ms.
Stopwatch: 72 ms.

but in GH it takes 4.1 seconds!
dfasdgfasfg

For details, this is the component code. I have attached a normal stopwatch to prove that my custom nested stopwatch (RunningTime) it does not fail.

Something is happening to make such a big difference and I have no idea what it could be. Can someone shed some light so I can prove something?

Thanks.

4 posts - 2 participants

Read full topic

GrasshopperReloadAssemblies

Drawing a line from Point to Cursor during GetPoint

$
0
0

Hi there,

I have a c# component to pick two points and try to preview a line during the second GetPoint operation. The line only gets updated when I manipulate the camera and not when I move the mouse.
Maybe I subscribe to the wrong event?

private void RunScript(ref object A)
  {
    Rhino.Input.Custom.GetPoint getPt = new Rhino.Input.Custom.GetPoint();

    getPt.Get();
    basePt = getPt.Point();

    // Preview Line for second GetPoint
    getPt.DynamicDraw += drawMethod;
    getPt.Get();

    display.Dispose();
  }

// <Custom additional code> 
Rhino.Display.CustomDisplay display = new Rhino.Display.CustomDisplay(true);
Point3d basePt = new Point3d();

void drawMethod(object sender, Rhino.Input.Custom.GetPointDrawEventArgs e)
{
  display.Clear();
  display.AddLine(new Line(basePt, e.CurrentPoint), System.Drawing.Color.DodgerBlue, 10);
}

5 posts - 2 participants

Read full topic


Osnap in GHPython/Rhinocommon

$
0
0

When working in Rhino from the viewport you are able to use the Osnap to snap points to other points.
I am specifically interested in the “Snap to Near” flavour of Osnap.
Is it possible to do through Rhino Common?

I was able to find a couple of Snap Points methods under the GetPoint class in the Rhino Common API, but haven’t had the time to test them out yet.

Kind Regards,

VBL

1 post - 1 participant

Read full topic

VS C# Reading another components data in the base.read/base.write

$
0
0

Hi all,

I have a component to update panels to default values if needed.
The GUIDs of the target panels are saved in my component through this method.

writer.SetGuid("targetPanelComponentGuid", targetPanelComponentGuid);

I’m working on a function to update all of my panels in the entire canvas. But how should I approach it?
I would imagine something like this;

ghDocument = OnPingDocument();
List<IGH_ActiveObject> allActiveObjects = ghDocument.ActiveObjects();

foreach (IGH_ActiveObject activeObject in allActiveObjects)
{
    if (activeObject.ComponentGuid.ToString() == "e40ccee5-232e-44a0-9624-fb0ea34a833a") //being this type of object
        {[DefaultPanel_VS.zip|attachment](upload://4fGLxmlvOLeVQlAXlYh2h6YhuiS.zip) (3.7 MB) 
            var panelGuid = activeObject.Reader["targetPanelComponentGuid"]; //<-- bugger

            UpdatePanel(panelGuid); // some treatment of the newly retrieved Guid.
         }
}

Screen below probably explains it better.
Each component is working well in my setup - however I would like to have a function in the component to activate all the other components also.
So either calling a class/method locally on the other components - OR - get the guids of their connected panels (that i now have in the write/read)

4 posts - 2 participants

Read full topic

Curve Boolean

$
0
0

Hi All,

I am trying to get a set of closed curves out of a group of both closed and open curves in c# as in “Curve Boolean” commend in rhino. Please see the attached image where I select all curves and set the inner region to get separate closed curves.


Any suggestions will be much appreciated.

6 posts - 3 participants

Read full topic

Polygon weld to Tekla via Grasshopper C#

$
0
0

Hello!

I am working on a project were I have to insert a lot of polygon welds, and I would like to make it happen via grasshopper and C# (as the beams and plates are already generated with it).

I would like to weld the orange rounded plate to the end of the red beam.
plate

The problem is I only have very basic knowledge on C# and however the code runs, the result is “Null” and can’t figure out why.

My code so far:

private void RunScript(System.Object P1, System.Object P2, object P3, object P4, object P5, System.Object MainPart, System.Object SecondPart, double Size, int Work_Site, ref object PWeld)
  {

    Tekla.Structures.Model.Part mainpa = (Tekla.Structures.Model.Part) MainPart;
    Tekla.Structures.Model.Part secpa = (Tekla.Structures.Model.Part) SecondPart;
    Tekla.Structures.Geometry3d.Point point1 = (Tekla.Structures.Geometry3d.Point) P1;
    Tekla.Structures.Geometry3d.Point point2 = (Tekla.Structures.Geometry3d.Point) P2;
    Tekla.Structures.Geometry3d.Point point3 = (Tekla.Structures.Geometry3d.Point) P3;
    Tekla.Structures.Geometry3d.Point point4 = (Tekla.Structures.Geometry3d.Point) P4;
    Tekla.Structures.Geometry3d.Point point5 = (Tekla.Structures.Geometry3d.Point) P5;
    Tekla.Structures.Model.PolygonWeld WeldF;

    var weldEnum = secpa.GetWelds();
    if (weldEnum.MoveNext())
    {
      WeldF = weldEnum.Current as PolygonWeld;
    }
    else
    {
      WeldF = new PolygonWeld();
    }

    PolygonWeld PolygonWeld = new PolygonWeld();
    PolygonWeld.MainObject = mainpa;
    PolygonWeld.SecondaryObject = secpa;
    PolygonWeld.Polygon.Points.Add(point1);
    PolygonWeld.Polygon.Points.Add(point2);
    PolygonWeld.Polygon.Points.Add(point3);
    PolygonWeld.Polygon.Points.Add(point4);
    PolygonWeld.Polygon.Points.Add(point5);
    WeldF.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET;
    WeldF.SizeAbove = Size;
    WeldF.MainObject = mainpa;
    WeldF.SecondaryObject = secpa;

    if (Work_Site == 1)
    {
      WeldF.ShopWeld = true;
    }
    else
    {
      WeldF.ShopWeld = false;
    }
    if (secpa != null)
    {
      if (mainpa != null)
      {
        if (WeldF.Identifier.IsValid())
        {
          WeldF.Modify();
        }
        else
        {
          WeldF.Insert();
        }
        PWeld = WeldF;
      }
    }

    new Tekla.Structures.Model.Model().CommitChanges();
  } 

Any suggestions how to make it work?


GH_Tekla_PolyWeld.gh (19.6 KB)

Thank you!

Zsolt

1 post - 1 participant

Read full topic

Simulating Fritted Glass

$
0
0

Hi everyone

I am trying to run a glare and daylight simulation on a space which has glazing with a fritted pattern. The way I have tried to model the glazing so far is by having Grasshopper construct the individual fritted surface patterns onto the glazing surfaces in Rhino. The problem I am having is that since the frit density is 50% and the size of the circular frit patterns are very small - this means that Grasshopper must construct 100’s of thousands of surfaces and this causes it to run for an extremely long period of time and eventually crash. I have considered adjusting the VLT or opacity of the glazing to represent a fritted glass panel, however I do not know how to calculate the equivalent VLT of a glazing with 50% frit density.

Some of the research I have done toom me to this article https://www.sciencedirect.com/science/article/pii/S1876610217329387 in which fritted glass was simulated using Radiance “trans material”.

In summary - does anyone have any ideas about:

  1. Alternate ways of simulating Fritted Glazing
  2. Estimating VLT based on a frit Density
  3. Using Radiance Trans Material

1 post - 1 participant

Read full topic

Viewing all 3639 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>