Import / Export Visualarq Parameters

I’m attempting to transfer custom made visualarq parameters from one file to another. Is there a simple clean way to import / export parameters like there is with visualarq styles?
Does anyone know of a python script that could do this?

Thanks!

Hi @arcus ,
Are all of them VisualArq document parameters?
If yes, then run this script to print all parameters in the current .3dm file:

import clr
import sys

# import VA assembly
sys.path.append(r"C:\Program Files\Rhino 6\System")
clr.AddReference("VisualARQ.Script")
import VisualARQ.Script as vs


# print all document parameters in current .3dm file
id_L = vs.GetAllDocumentParameterIds()


docParamName_L = []

for id in id_L:
    docParamName = vs.GetParameterName(id)
    docParamName = docParamName.capitalize() # FIX to convert for example: 'material' to 'Material'
    docParamName_L.append(docParamName)

print docParamName_L

The parameter names which will be printed at the end of the upper script: copy paste them in this script below, and run this second script inside a new .3dm file:

import System
import clr
import sys

sys.path.append(r"C:\Program Files\Rhino 6\System")
clr.AddReference("VisualARQ.Script")
import VisualARQ.Script as vs


# create new document parameters
docParamName_L = ### COPY-PASTE parameter names from previous script run here! ###

for docParamName in docParamName_L:
    param_id = vs.GetDocumentParameterId(docParamName)
    
    if param_id == System.Guid.Empty:
        # such document parameter name has still not been created. Create it:
        
        # default inputs
        parameterType = vs.ParameterType.Text
        parameterCategory = 'General'
        paramDescr = ''
        
        param_id = vs.AddDocumentParameter(docParamName, parameterType, parameterCategory, paramDescr)
3 Likes

That worked like a charm! Thank you so much for your help, I really appreciate it!

1 Like

Hi,
i am currently trying to impelment this script. I am having some problem. Should i run this in “RunPythonScript”? I am getting such result just bracket!

Hi @Hassan_Nawaz,

It is working fine for me. You need to run it with “EditPythoScript” in order to copy the parameters in from the first code to the second code.

Thank you. I am doing with “EditPythonScript”.
I am not sure why i am getting empty lists. Could you please share some more info? Thanks in advance

Hi @Hassan_Nawaz,

Which kind of parameters are you trying to export? Are they document, style or object parameters?

I am trying to export object parameters. For example, the following plate should be having the following parameters and i wanted to export these as data in excel. Update it and again import in the model to update the parameters with this excel.

Hello @Hassan_Nawaz,

The Python scripts above are exporting document parameters, not object parameters (you could use the GetObjectParameterId() in the script to get the object parameters you need).

Anyway, if you need to export those parameters to Excel it is easier to create a VisualARQ table with those parameters and export the table to Excel.

To update those parameters after modifying them in Excel, maybe you can read those Excel values using Grasshopper and use the “Update Property” VisualARQ Grasshopper component to update them in VisualARQ.

1 Like

Thank you very much. I will try it. Really appreciate

1 Like