Getting the parameter variable names (i.e. input names) from a custom reporter

So, I'd like to be able to get the variable names for the parameters of a custom reporter

e.g. radius, bodyHeight and coneHeight in this example

OpenSCAD_4_0_0_dev script pic (1)

but my Snap! foo has deserted me (again) :slight_smile:

Can you be more descriptive?

You looking for this? @cymplecy
untitled script pic 25
Block labels never change after creation (well unless you specifically use the blocks that change them) so I don’t see much of a use.
That’s why I think I might be wrong?

You have to explicitly ringify the “a”

I'm after getting the names of the parameters declared in the hat

I've got this

which has the parameters in the first row but that seems a strange place for them to end up at and I'm not too sure I can get at them programmatically as if I try a different custom reporter then the parameter names position moves

Is that what you were looking for?
From the looks of it you should be able to exclude the first to list items and then that’s it

@cymplecy this should work

If you look at the outputs of both reporters - you'll see that in 1st - parameters start at column D but in 2nd they start at column C

Which makes it tricky to decide where they start

Does that work for 1st example?

Because it has a text item in column B - so I think no :frowning:

Well you would do columns of

I think I've come up with a general solution

OpenSCAD_4_0_0_dev script pic (4)
gives the number of parameters so I should be able to make a reporter to get the correct number of parameter names

Why call with inputs and not just put the block directly in?
Doesn’t that just make it more complicated?

The actual code uses a script to deliver the custom reporter and if f I don't use call I've found I just get information on the script and not the custom reporter itself

This is my current solution - a custom reporter to report the slot names of a custom reporter

OpenSCAD_4_0_0_dev script pic (5)

and this is how I'm actually using it in my project as the custom reporter is reported via a script so needs a call wrapped around it


OpenSCAD_4_0_0_dev script pic (6)

Relabelled and updated to handle simple custom reporters that only have a single reporter block in them

OpenSCAD_4_0_0_dev script pic (8)

you also can just use codification

Could you post a script/custom block to do it that way?

untitled script pic (9)

oh wait, i was confused.
yeah, i had the same question in past, and i used that method with splitting custom block too.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.