Article | 41024296 |
Type | HowTo |
Product | Engine |
Version | 5.1.1.1042 |
Date Added | 9/22/2006 |
Submitted by | Craig Willox |
Keywords |
I’m just trying to make a simple section clipping to restrict what can be shown and hidden at certain heights. But I can’t seem to get it to work correctly even in a very basic example. Are you able to see why the code below wouldn’t simply hide everything that isn’t between the heights of 5 and 10 DU?
Do I need to set the surface area of the Section Clips at all? Or is it an infinite plane? Also, How does the last variable work (calculateNormal)? I can’t seem to find any documentation on it at all.
private void button1_Click(object sender, EventArgs e)
{
VD.ActiveDocument.New();
VD.ActiveDocument.ActiveColor.ColorIndex = 1;
VD.CommandAction.CmdSphere(new object[] { 0, 0, 7.5 }, 7.5, 20, 20);
VD.CommandAction.Zoom("W", new object[] { -15, -15, 0 }, new object[] { 15, 15, 0 });
VD.CommandAction.View3D("VISE");
}private void button4_Click(object sender, EventArgs e)
{
VD.CommandAction.View3D("VROT");
}
private void button2_Click(object sender, EventArgs e)
{
vdxyz pos1 = (vdxyz)VD.CreateInstance(VdConstObjectType.OBJ_XYZ);
pos1.SetValueEx(0, 0, 10);
vdxyz dir1 = (vdxyz)VD.CreateInstance(VdConstObjectType.OBJ_XYZ);
dir1.SetValueEx(0, 0, -1);
vdSectionClip clip1 = VD.ActiveDocument.Model.Sections.Add("TOP" , pos1, dir1, 0);
// Bottom Facing Up
vdxyz pos2 = (vdxyz)VD.CreateInstance(VdConstObjectType.OBJ_XYZ);
pos2.SetValueEx(0, 0, 5);
vdxyz dir2 = (vdxyz)VD.CreateInstance(VdConstObjectType.OBJ_XYZ);
dir2.SetValueEx(0, 0, 1);
vdSectionClip clip2 = VD.ActiveDocument.Model.Sections.Add("BOTTOM", pos2, dir2, 0);
VD.Redraw();
}