내 주요 방법은 Grasshopper 3D라는 소프트웨어에 사용 된 SolveInstance()
방법입니다.이 도구 자체는 Rhino의 플러그인입니다.사용하기 전에 색상 및 복식 목록 반전
두 가지 새로운 목록을 선언합니다. 처음에는 List<Color> colors
과 List<Double> spaceValues
이 각각의 색상 및 이중 객체를 저장하는 데 사용됩니다.
다음 라인 :
if (!DA.GetDataList(0, colors)) return;
if (!DA.GetDataList(1, spaceValues)) return;
단순히이 목록에 값을 저장하는 데 사용됩니다.
내 코드 :
내 질문이있다 List<Color> colors = new List<Color>();
List<Double> spaceValues = new List<Double>();
if (!DA.GetDataList(0, colors)) return;
if (!DA.GetDataList(1, spaceValues)) return;
int width = 10;
int height = 0;
int U = 1; // numbers of x-objects
int V = 100; // number of y-objects
DA.GetData(2, ref height);
string file = null;
bool save = false;
DA.GetData(3, ref file);
DA.GetData(4, ref save);
HeatMap map = new HeatMap(colors, width, height, file, U, V);
_maps.Clear();
_maps.Add(map);
- 그것으로 어떻게이 두 목록을 반전 할 구문 분석하기 전에 : 내가 시도
HeatMap map = new HeatMap(colors, width, height, file, U, V);
colors.Reverse().ToArray()
및
colors.ToArray().Reverse()
, 모두를하고 나에게 오류를 돌려 줬어. 고맙습니다.
이것은 내가받은 오류입니다. http://puu.sh/6gpjW/628fbd6cbe.png – theGreenCabbage
가능한 복제본 [C# 목록 반전을 시도 중입니다] (http://stackoverflow.com/questions/6980608)/c-sharp-to-reverse-a-list) –