Create VisualArq Wall from Python Script

I have been playing with Visual Arq and looking into possibilities creating objects through scripting.
I ran into this post and was able to run a similar script to create spheres.

I am stuck trying to create walls, I was hoping someone could point me in the right direction.
I got this far but I don’t have a lot of experience with RhinoCommon, so I am not sure if I am doing something wrong, missing a step, or if there is an issue with the public API since it’s WIP.

import rhinoscriptsyntax as rs
import Rhino as rc
from Rhino import Geometry as geo

import clr
clr.AddReference('VisualARQ.Script')
import scriptcontext as sc
import VisualARQ.Script as va

doc = sc.doc
unit_scale = rc.RhinoMath.UnitScale(rc.UnitSystem.Meters, doc.ModelUnitSystem);
wall_style_id = va.GetGenericElementStyleId('Default')
wall = va.AddWall(wall_style_id , geo.Point3d.Origin, geo.Point3d(10,0,0))
print(wall)  # output: '00000000-0000-0000-0000-000000000000'
  1. Expected wall guid to non zero.
  2. If I had a valid guid, how would I convert a VA objects added to Document? rs.coercebrep?

Thanks!

PS: @enric

Hi @gtalarico1,

The problem is that you’re using a Element Style instead of a Wall Style. Here is a sample using the current wall style:

import rhinoscriptsyntax as rs
import Rhino as rc
from Rhino import Geometry as geo

import clr
clr.AddReference('VisualARQ.Script')
import scriptcontext as sc
import VisualARQ.Script as va

doc = sc.doc
unit_scale = rc.RhinoMath.UnitScale(rc.UnitSystem.Meters, doc.ModelUnitSystem);
wall_style_id = va.GetCurrentWallStyle()
wall = va.AddWall(wall_style_id , geo.Point3d.Origin, geo.Point3d(10,0,0))
print(wall)

Regards,

Enric

1 Like

I don’t understand this question. VisualARQ objects are regular Rhino blocks, so you can get the internal geometry using native RhinoCommon methods.

This worked. Thank you for your help!