Grasshopper

algorithmic modeling for Rhino

Hi Guys,
I am trying to define a custom type to use it in between some component I am developing.I encountered a problem you may already know how to solve and can help.
my data type is a class like this:
 public class BaseProfile()
public BaseProfile(params object[] cellList)
 { this.ArticleNumber = (int)cellList[0];
   this.SystemName = (string)cellList[1];
    this.Material = (string)cellList[2];
    this.Shape = (string)cellList[3];
 ...}
then I define:
public class ProfileGHData : GH_Goo<BaseProfile>
and then:
public class ProfileGHParam : GH_Param<ProfileGHData>
here i define an ouput parameter which is a ProfileGHParam:
 pManager.AddParameter(new ProfileGHParam(), "blahblah", "bl", "Load Blahbalh", GH_ParamAccess.item);


in the SolveInstance It reads lines of a csv file split them with ; and then puts them in an array then make an instant of BaseProfile called profile1 and assign the array to profile1 like this:


BaseProfile profile1= new BaseProfile(cell1);


Now i need to somehow take profile1 and put it into a variable of type
ProfileGHParam. to use setdata() for it.but i can not find a way.
I defined an instant od ProfileGHParam and looked at methods available but did not get it . i thought cause it is  inherited from BaseProfile I may be able to cast or use a method to assign profile1 to it,also i tried to add a constructor to ProfileGHParam to get rid of BaseProfile but no luck.Probably I 've made it too long and complicated in the class definitions also and can be shorter.

Any idea and hint will be highly welcomed
  Thanks in advance
Kaveh

Views: 267

Comment

You need to be a member of Grasshopper to add comments!

Comment by AmelieAtkins on April 14, 2021 at 1:35am

Information technology has made the world very entertaining as we can do anything we want at anytime and anywhere. Our lives have also become more entertaining owing to development in technology. Probably every activity of life is fun in this era. Well, reading https://us-reviews.com/blog/ferpa-guidance-for-students-legitimate-... article gave me interesting ideas about how I could make my education interesting for me.

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service