michaelk Posted May 31, 2020 Share Posted May 31, 2020 What does "Bad Input" mean as a return for a subtract solid? I'm trying to subtract solids in a parametric object. If I ungroup the parametric object and subtract the solids they work fine. But in the script they return 20. Any ideas? Quote Link to comment
MullinRJ Posted June 1, 2020 Share Posted June 1, 2020 Have you verified your handles are correct inside the PIO? Without seeing any code that is my only guess. Raymond Quote Link to comment
michaelk Posted June 1, 2020 Author Share Posted June 1, 2020 Yep. I even made unique handle variables. I started by drawing two solids and subtracting them and then exporting the script, just to make sure I was doing it right. SubtractSolid(bigObject,smallObject,subtractedObject) returns 20. (Bad input). I'm now trying to work around the subtraction. If it doesn't work I'll go back and get the subtraction code and post it. Quote Link to comment
MullinRJ Posted June 1, 2020 Share Posted June 1, 2020 So, what types are the objects? Place this just before or after the SubtractSolid() command. AlrtDialog(concat( bigObject, ' ', GetTypeN(bigObject), chr(13), smallObject, ' ', GetTypeN(smallObject) )); Are they what you think they are? If so, then I got nuttin' without seeing some code. Raymond Quote Link to comment
JBenghiat Posted June 10, 2020 Share Posted June 10, 2020 I think the stacking order makes a difference. Make sure that you create your bigObject first. Quote Link to comment
The Hamma Posted April 7, 2023 Share Posted April 7, 2023 Did you find a solution to this. I am getting the same Bad Input error. Quote Link to comment
michaelk Posted April 7, 2023 Author Share Posted April 7, 2023 I must have figured it out. I'm not positive what I was working on 2 years ago. But I think it might be this: BeginXtrd(0,pHeight); RectangleN( 0,(0-(pBoxWidth/2)), 1,0, pLineLength,pBoxWidth); tempHand := LNewObj; SetObjectVariableBoolean(tempHand, 1160, TRUE); EndXtrd; tempHandle1 := LNewObj; BeginXtrd(0,pHeight); RRectangleN( 0,-pBoxWidth/2, 1,0, pLineLength,pBoxWidth, pBoxWidth,pBoxWidth); RailShape2D := LNewObj; SetObjectVariableBoolean(RailShape2D, 1160, FALSE); RRectangleN( pBoxWidth/2,-pBoxWidth/2, 1,0, pLineLength-pBoxWidth/2,pBoxWidth, WeeCircleDiameter,WeeCircleDiameter); tempHandle := LNewObj; SetObjectVariableBoolean(tempHandle, 1160, FALSE); RailShape2D := AddSurface(RailShape2D,tempHandle); SetObjectVariableBoolean(RailShape2D, 1160, FALSE); HScale2D( RailShape2D, pLineLength/2,0, 1 - 2*pSideThickness/pLineLength,1 - 2*pSideThickness/pBoxWidth, FALSE); tempHandle := LNewObj; SetObjectVariableBoolean(tempHandle, 1160, FALSE); EndXtrd; tempHandle2 := LNewObj; resultInt := SubtractSolid(tempHandle1,temphandle2,SubtractHan); That works. Quote Link to comment
Walter Rojas Posted May 2, 2023 Share Posted May 2, 2023 Almost exactly the same thing here but I cannot even set boolean var to 1160, I have an error 'operation not allowed with this kind of object' or something (is in spanish). I have the fatal 20 error trying to use vs.SubtractSolid() with an extrusion and a solid. Quote Link to comment
Walter Rojas Posted May 2, 2023 Share Posted May 2, 2023 (edited) 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 Edited May 2, 2023 by Walter Rojas Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.