Private void RunScript error

bug
csharp
(P D Siedler) #1

Hi guys, quite odd of an error I’m getting here. Any idea how to fix this? - I can’t even edit line 74
Cheers, Phil

0 Likes

#2

A file would help. The code windows hides the inputs and outputs, of which at least one Input/Ouput name seems to have a problem. But it’s all hidden behind the code window.

// Rolf

0 Likes

(P D Siedler) #3

Thats not the point. The point is that the error sasys that there is a “)” missing in line 74, which is not editable.

0 Likes

#4

The point is that line 74 IS editable, just not directly. That line is automagically generated by editing the Inputs and Outputs (on the capsule), which are hidden behind the code window.

A general advice is to not assume that you know what the problem is if you are asking for help after not resolving it yourself.

As said, a file would help. And also take a look at #3 in the following link: How to ask effective questions

// Rolf

0 Likes

(P D Siedler) #5

Right. In that case it should be very easy for you to recreate that simple syntax error, right?

0 Likes

#6

You are hiding the problem.

Strange this. You hide the (probable) cause of the error, and you consistently refuse to provide the file, and you expect someone to do recreate that something, which you hide from us, in order to try to help you solve (who knows what).

Your attitude is really really (really) strange. Really really strange. I’ve never seen anything like this on a forum before, but i don’t want to respond in kind.

I tried to help you, but you won’t cooperate. Strange.

// Rolf

2 Likes

(P D Siedler) #7

Its because the problem is generic enough. Thank you for your help so far. I’ll wait for someone else to reply.

0 Likes

(Michael Pryor) #8

As @RIL said. File will help as that error is based on things set by input / output. Since your screenshot is cut off and we can’t see all your inputs or code, what my guess is that you have “heMesh” set as system.object and you probably meant for it to be a mesh, if so, set that input type to mesh. If that is not the problem then upload the file.

0 Likes

(P D Siedler) #9

Thank you. Yes I’m passing system objects using: GH_ObjectWrapper wrapped = new GH_ObjectWrapper(values);

This would be the input parameters:
private void RunScript(System.Object heMesh, List colors, Interval interval, int mapID_display, bool play_pause, bool reset, int seedPts, List particles, System.Object attractors, System.Object lightSources, System.Object obstacles, System.Object circulation, double mapsWeight, double collisionWeight, double circulationWeight, double noiseWeight, double noiseScale, bool updateRadius, List radiiList, Interval radiiInterval, List proportions, double threshold, double gap, bool duplicateCircles, double maxStress, int stressLimit, double minFit, int fitnessLimit, bool contrast, double animate, bool output, ref object debug, ref object Circles, ref object Flag, ref object Colors, ref object Particle Count, ref object Map, ref object MapValues)

component:


part 1 of the input parameters screen shot:

part 2 of the input parameters screen shot:

its almost impossible to send the file due to custom dlls and ~30 input parameters.
Everything worked perfectly fine, I have not changed the state of input parameters i.e. - I cleaned up some code and the c# component broke at some point.

0 Likes

#10

You still didn’t do as I suggested you to do - you didn’t uncover ALL the Inputs and Outputs although I indicated that they are the source of the problem (You can know that from the error messages).

Anyway, I analysed the text from line 74 (the resulting error) and found a candidate source for your problem. As jerky as I am I will hint you yet another time, regardless whether you will listen or not, to get rid of the space character in the output named “Particle Count” which you hid from us (a screen capture of the capsules inputs and outputs would show the SOURCE of the problem, not the RESULTING error, but anyway).

Line 74 has a space char in an output name which probably is the cause of your problem which messes the whole thing up (look for the star*, there’s a space char there which shouldn’t be there);

ref object Particle*Count,

If this was the problem then you know why an experienced user asked you to show your inputs and outputs, since those are the only possible cause of the problem. Look here what a simple screenshot can do if you don’t hide anything:

bild

After you have removed or replaced the space char, please zoom in and add another output and then immediately remove it again. In so doing you ensure that the internal component will automagically update all output and input names and types on line 74 properly.

// Rolf

0 Likes

(P D Siedler) #11

Well thank you for your help. Now I just can’t explain how that happened. I must have been asleep or elsewhere. There were a couple of other artifacts, like renaming of obvious variables, is it possible that this goes hand in hand? Never had that before and it’s not my first component, so again, can’t explain how I missed it or how that exactly happened. Thanks again, sorry this was painful of sorts.

0 Likes

#12

You are not alone in having had painful experiences with the input/output names. I hope you succeed very well with your component. And don’t hesitate to ask if more problems occur. There are many here who are very helpful.

All the best
// Rolf

0 Likes