I would like to get parameter of a grasshopper model that I import using VisualARQ in Rhino.
I wrote following code to obtain parameter value but the value object I got was null everytime.
using va = VisualARQ.Script;
Guid[] parameterIds = va.GetAllObjectParameterIds(blkInstance.Id, true);
foreach (Guid paramId in parameterIds)
{
// GetParameterName
RhinoApp.WriteLine(va.GetParameterName(paramId));
// GetParameterValue
object paramValue = va.GetParameterValue(paramId, blkInstance.Id);
}
PS: Are there any examples using VisualARQ Script API using C# and RhinoCommon?
At first look, the code seems right to me. Take into account that VisualARQ Script API only works on objects in the document, and it doesn’t work with Grasshopper. If you want to get parameters inside a Grasshopper definition, there are specific components.
I’ve tried your code in a RhinoCommon C# plugin, and it works fine.
Thanks for your reply. The model is imported as a style from a Grasshopper file using VisualARQ, I would like to get the parameters for this model just like the properties shown in VisualARQ Property Panel when you select the model. I have attached the 3DM model and the Grasshopper file that I used.
Thanks for your time
-sam
3DM file BOX.3dm (84.8 KB)
Grasshopper file BOX.gh (17.4 KB)
Why are you doing this using a C# script component? As I told you earlier, our VisualARQ.Script.API is not meant to be used inside a Grasshopper definition.
There are several Grasshopper Component to get properties, parameters, and their values.
Ignore my last post. I didn’t read correctly your message.
I’ve found the problem. When we created the parameters for VisualARQ, we added the “Integer” type as an unsigned integer (commonly named “Natural number”). Then we used those parameters in the Grasshopper Style feature, but as “Intergers” in Grasshopper can have negative values, we used a signed integer.
The problem is that VisualARQ Script API has no support for signed integers yet. I’m going to fix this for VisualARQ 2.13. If you want, I can send you a WIP build as soon as I implement it.