Jump to content
Developer Wiki and Function Reference Links ×

Subtract Solid = 20


Recommended Posts

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.

Link to comment

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

Link to comment
  • 2 weeks later...
  • 2 years later...

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.

Link to comment
  • 4 weeks later...

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 by Walter Rojas
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...