Match attributes

Hi all,

is there a way to do a match-properties on the VisualArq attributes of an object? Without using the styles?
Sometimes I like to set them manually per object, to have a proper lineweight and hatch on the drawing, without wanting to make a new style.

thanks!

2 Likes

Hi @isolabella the Rhino “Match Properties” command works on VisualARQ objects with the existing Rhino object properties, but it doesn’t work with the “section attributes”. I take this request for the future development.
image

2 Likes

Any progress in implementing section attributes to rhino matchproperties command or ading VAmatch command to VA_plugin directly?

Hi @MatZed No news on this feature. We may implement it in VisualARQ 3.X version. I will keep this thread posted.

I was about to ask for the same - I’ll just add my voice to this request.

Something similar to “Match Properties” but for the Parameters and Section Attributes would be very handy. I know that we can sort of solve the matching of Parameters in GH, but it is a too long way around the problem.

If you do implement such a feature - please do add “Select all” “Select none” buttons in the menu :slight_smile: Thanks.

1 Like

Hello @Czaja,

Do you mean “Select all VisualARQ objects”?

I’ll add your vote to the Match Attributes issue,

I mean something like this in the “Match Parameters” window

There can be many parameters, and if we only want to match one of them, then Select None + (selecting the one we want) is very helpful shortcut. I know it is not something important, but vanilla Rhino doesn’t have these buttons in “Match Properties” and I felt the lack of them many times.

1 Like

Ok, thank you! I will add this request as well

1 Like

adding my vote to this feature request.

1 Like

Adding my vote on this request !

Are there any news on the development of visual arq 3 ?

1 Like

@dannysquires , @raoufdjema15 added your votes on this feature to keep you posted when it comes true.

You can check the VisualARQ roadmap’s page to see the planned features (not specified if they will be included in VisualARQ 3 or in future versions), the features that are currently in progress (probably included in VisualARQ 3), and the features done in our internal Work In Progress versions of VisualARQ 3: Roadmap - VisualARQ

Is it possible to do this with a user script?

Hi @Mich, there’s no API yet to achieve this through a user script.

Hi,

Since the latest API functions allow it, I did a small python script that kind of answers this feature request. It does not include the Select All and Select None request from @Czaja but it still is quite useful to quickly copy parameters from one object to another without using Grasshopper.

I also used the Document User Text to save the last selected parameters. Don’t know if it’s a good practice, but it does the job :slight_smile:

Here is the script:

import rhinoscriptsyntax as rs
import clr
clr.AddReference("VisualARQ.Script")
import VisualARQ.Script as va

def va_match_parameters():
    objs_to_modify = rs.GetObjects("Select objects to modify", filter=0, preselect=True)
    if not objs_to_modify:
        print("No objects selected.")
        return

    source_obj = rs.GetObject("Select source object", filter=0, preselect=False)
    if not source_obj:
        print("No source object selected.")
        return

    rs.EnableRedraw(False)

    source_parameters_ids = va.GetAllObjectParameterIds(source_obj, True)
    parameter_names = [va.GetParameterName(param_id) for param_id in source_parameters_ids]

    last_selected = rs.GetDocumentData("MatchParameters", "LastSelected")
    if last_selected:
        last_selected = last_selected.split(",")

    check_list_items = [(param, (param in last_selected if last_selected else False)) for param in parameter_names]

    parameters_to_copy = rs.CheckListBox(check_list_items, "Select Parameters to Copy", "Choose parameters:")
    if not parameters_to_copy:
        print("No parameters selected.")
        return

    selected_parameters = [param for param, checked in parameters_to_copy if checked]
    rs.SetDocumentData("MatchParameters", "LastSelected", ",".join(selected_parameters))

    for obj in objs_to_modify:
        for param in selected_parameters:
            param_id = source_parameters_ids[parameter_names.index(param)]
            param_value = va.GetParameterValue(param_id, source_obj)
            va.SetParameterValue(param_id, obj, param_value)

    rs.EnableRedraw(True)
    print(str(len(objs_to_modify)) + " objects modified.")

if __name__ == "__main__":
    va_match_parameters()

Let me know if it produces any bug, I’ll update it to match more use cases

1 Like

Sometimes I can’t believe that I find my 3-year-old posts in 6-year-old wish-threads. Especially when it’s about something obviously lacking and it’s stopping me from using Visual ARQ or Rhino with the functionality that it supposedly currently has.

@antoine3
Thank you very much for your script, there are some issues, maybe I will fix them.

ModuleNotFoundError: No module named ‘VisualARQ.Script’

After I changed it to simply import VisualARQ as va script runs but it stops while trying to copy the attributes with the error

AttributeError: GetAllObjectParameterIds

2 Likes

Hi @Czaja,
Your bug could be a matter of VisualArq version. Which version are you running?

Changing

import clr
clr.AddReference("VisualARQ.Script")
import VisualARQ.Script as va

into

import VisualARQ as va

does not seem to be a correct solution, I always imported VisualArq this way and I think it is the regular use of it since I got it from VisualArq scripting examples.

Even if it allows the script to run on your machine, you get the next bug because your script can’t find the VisualArq GetAllObjectParameterIds method (which makes sense since the library you’re importing may not include this method).

I strongly suppose it’s a matter of VisualArq version, since the API has evolved a lot lately.

@Czaja check the VisualARQ Labs as well. It includes some commands to match properties between VisualARQ objects and section attributes between Rhino objects.

2 Likes

Hi,
I forgot about VisualARQ Labs, thank you. Indeed, there is a tool that mostly do what I want. It doesn’t work with Blocks, but this might be a Rhino issue.

There is one weirdness that you might want to solve.

When selecting objects you need to:

  1. Select object to modify, accept,
  2. Then it’s once again asking you to select objects to modify where you shouldn’t select anything (otherwise your objects will be copied)
  3. Finally it’s asking you to select the source objects.

Video shows how this script can produce multiple copies of an object

Hi @Czaja
After selecting the objects to modify, you need to hit ENTER twice, and not select the same object again, otherwise a new copy will be created for each repeated selection.

The fact you need to click twice during the second step happens due to an error (in my opinion) in the Get object component in Grasshopper, that we cannot fix, because it’s a native Grasshopper component. I’ve reported this on YouTrack some time ago, if you want to follow it up, but there is no scheduled version to fix this: https://mcneel.myjetbrains.com/youtrack/issue/RH-74244/Get-Geometry-components-prompts-you-to-hit-Enter-twice-after-selecting-objects

The other commands that reference VisualARQ objects in the Labs don’t have this problem because they use a different “Get Object” component (developed by our team) that prevents this from happening.

Ah, so it’s a Grasshopper Player definition? Nice. Do you use any custom scripting components inside or only vanilla Grasshopper to achieve this functionality?