Grasshopper

algorithmic modeling for Rhino

Any way to put a Grasshopper Panel() with text in the canvas by vb code?

Hi,

As the title says, is there any way to put a Grasshopper Panel() with text in the canvas by vb code?

Views: 3178

Replies to This Discussion

Hi, 

Perhaps you could save your solution as a .ghx file and then insert it as xml ? either through a second grasshopperscript or seperate rhino plugin that opens and writes the file ? 

kind regards,

Elco

Hi,

Actually there is a way to integrate a GH_Panel but it's probably not what you need in this case.

I think what you need it's override your component's display (Attributes) and display your text.

You can also write your text in the balloon as warning or errors, probably the best if it's for input format.
this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Your text");

Florent

Well you can do it like this : document.AddObject(new GH_Panel())

But it will be a bit complex to manage everything, like position and also far from the basic rules of grasshopper.

It would be much simpler to have a string output with your text and connect it to a panel.

to add text I think you can try:

  panel.SetUserText("your text")

position :
            panel.Attributes.Pivot = new PointF("xPosition,yPosition");

I don't understand why you can't have a output for format errors and another for your merge result?

Sorry, I'm not sure of your last request?

Dim doc As GH_Document

doc = Grasshopper.Instances.ActiveCanvas.Document

Special.GH_Panel panel =New Special.GH_Panel()

doc.AddObject(panel , True)

panel.SetUserText("your text")

panel.Attributes.Pivot = new PointF(this.Attributes.Pivot);

And if you can determinate the format and give it to the user, why not just force it and dont ask to the user to do it?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service