Finally works (I didn't set booleans), Python version (sorry).
import vs
from solido import Solido
from panel import Panel
class PanelRidges(Panel):
def obj_vw(self):
an_el = self.ancho / self.num_el
al_el = self.alto
esp_el = self.espesor
div = 2
# This loop creates extruded ractangles and
# add them to have one solid
for i in range(0, self.num_el, 2):
s1 = Solido.fabrica_solido(an_el, esp_el, al_el, an_el * (i + 1), 0)
s2 = Solido.fabrica_solido(an_el, esp_el / div, al_el, an_el * (i + 2), 0)
r, s_act = vs.AddSolid(s1.h, s2.h)
if i == 0:
panel = Solido.fabrica_solido(an_el, esp_el / div, al_el, i, 0)
panel = panel.h
r, panel = vs.AddSolid(panel, s_act)
# I was getting the obj reference
# after rotating it, there I had
# 'Bad input' (20)
vs.SetRot3D(panel, 0, 0, -90, 0, 0, 0)
self.hueco = self.hueco_vw(300, 400, 550)
# If I use the solid reference before
# rotate it everything goes fine
r, panel = vs.SubtractSolid(panel, self.hueco)
return panel
# This method creates the geometry of
# the hole
def hueco_vw(self, an, al, esp):
vs.DSelectAll()
vs.BeginXtrd(0, esp)
vs.RectangleN(-an / 2, -al / 2, 1, 0, an, al)
r = vs.LNewObj()
vs.EndXtrd()
exh = vs.LNewObj()
return exh