Grasshopper

algorithmic modeling for Rhino

Hello,

I have a question about comparing unequal lists to eachother. I have a beam with 5 points, where on two points a reaction force occurs (see image):

Points:                        Points with reaction force:      Reaction force:

#0 {0.25, 0.1, 0.0}     {0.25, 0.1, 0.0}                    1071.43

#1 {0.45, 0.1, 0.0}     {7.25, 0.1, 0.0}                    1928.57

#2 {1.05, 0.1, 0.0}

#3 {4.75, 0.1, 0.0}

#4 {7.25, 0.1, 0.0}

Now I want to create a new list with the reaction forces at each point and if there is no reaction force "0" must be given, so I want to have:

#0 {1071,43}

#1 {0}

#2 {0}

#3 {0}

#4 {1928.57}

Does somebody has a solution

Note: The reaction forces are not always at the first and last point and can also occur in the other points

Thanks in advance

Views: 119

Attachments:

Reply to This

Replies to This Discussion

Something like this?

Attachments:

Yes something like that. But I want to script it with variabels so Grasshopper recognizes the reaction force per point itself and I dont have to select it by meself.

Are you looking for a solution using Python, VB or C#?

A python script

Something like this maybe (using in and list.index() to first check for value containment and then get the value index, remember to pass the input params as List Access and set type):

Exactly what I wanted.

Thanks

RSS

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service