Grasshopper

algorithmic modeling for Rhino

Hello forum, In relation to this topic and with good sugestion of giuilio I create a new post:

The process is as follows:
I would be able to position text annotations in rhinoceros.
These annotations are placed at strategic locations may change places and values.

-If the user changes the text then the values in GH is updated. (other component)
-If the user moves the text dot then its position is recorded for the next change.

 

subject original:

http://www.grasshopper3d.com/forum/topics/q-gradient-coloring-of-text

Views: 9054

Replies to This Discussion

Hello to you all,

Coming back to you after you formatted a definition for the understanding of my request.

In advance thank you, Giulio have you seen this new post?

Attachments:

Hi,

I hope you had good holidays.

I am copying here a piece of the previous answer from the linked thread above:

"Sure you can do it. But, as usual in Grasshopper, either something is an input or it is an output. It's less feasible to obtain something that is both input and output at the same time."

This falls into the same concept: you should choose what you want to apply the definition onto, and whether the text objects are inputs or outputs. With this state of things, even though I think I understand now the type of edition you would like to obtain, I cannot help.

If you plan, instead, on using some components in the definition only to retrieve values, you could do it like this (see attached script).

I hope this helps.

- Giulio
_______________
giulio@mcneel.com

Attachments:

Thank you for your return

But I do not understand! have you seen my definition I posted. I do not want my function centralized in a single component. I imagined: From the 2D polyline position values to vertex ID. Then use this position to place id "text dot."

Then search for the text dot with a change to recover the value present.

 

I hope that my definition is clear for you.

 

thanks a lot

Maybe to be combined script vb and script GH ???

Giulio, this code is not correct,

I don't understand, it's possible to recovered a position and text at the text Dot ???

Rhino.DocObjects.RhinoObject f = doc.Objects.Find(x);
if(f != null)
{
if(f.ObjectType != Rhino.DocObjects.ObjectType.TextDot)
{
Print("This id is no text dot"); return;
}

TextDot t = f.Geometry as TextDot;

if(t == null)
{
Print("Unexpected error."); return;
}

TextDot nt = (TextDot) t.Duplicate();

if(t != null)
nt.Text = repl;

A = nt;
P = nt.TextDotGeometry.Plane;
T = nt.TextDotGeometry.Text;
}

Thanks for naming me almost in every post, so... what is your name?

Anyways, you were close!

- Giulio
______________
giulio@mcneel.com

Attachments:

Remy,

Nice to to speak with you !

Well then,

To recap:
I am able to create dot text (your component) from the point.
I am able to retrieve text of dowry.
Is what I am able to know the ID of the text dot that I create?

Hi Remy,

I'd just like to point out that this answer is still valid:

 

"Sure you can do it [load or bake text dots]. But, as usual in Grasshopper, either something is an input or it is an output. It's less feasible to obtain something that is both input and output at the same time."

 

Obtaining the above usually involves other programming paradigms, or maybe other ways to approach the same thing. I can try to paraphrase.

If the first component bakes a new TextDot at each iteration, it will return a new ID every time. These new TextDots will slowly accumulate in the document, but let us assume this is not problematic. You will get a new ID even every time the component runs. So even if you modify that object, then the previous TextDot will be modified.

 

Still, I'd like to answer your two questions and I prepared a script which allows you to set the layer name and returns the new object id.

Please, if you need to customize this further, try to find programming support from specialized suppliers, or maybe I can suggest to join one of the .Net or Python programming trainings for beginners.

 

I hope this helps,

 

- Giulio
_______________
giulio@mcneel.com

Attachments:

One answer:

Is it possible to add the layer to this script?

    if(active)
    {
      Rhino.DocObjects.ObjectAttributes attr = new Rhino.DocObjects.ObjectAttributes();
      attr.ColorSource = Rhino.DocObjects.ObjectColorSource.ColorFromObject;
      attr.ObjectColor = cols;

      doc.Objects.AddTextDot(name, pts, attr);
    }

 

Sure, this is also answered in the previous entry.

Thanks,

- Giulio
_______________
giulio@mcneel.com

Thanks giulio,

It's perfect...

 

You're right,

I'll ask a friend of mine developers for help.

I would come back to you to show you the result, at least a big thank you.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service