| Article | 60000582 |
| Type | Wish |
| Product | Engine |
| Date Added | 7/22/2008 12:00:00 AM |
| Fixed | (9/2/2009 12:00:00 AM) |
| Submitted by | Thomas Schmitz |
Summary
Support of NamedViews and UCS
Solution
In order to support Views and NamedUCSs 4 new objects have been implemented.
vdView object is the object that has properties to support a view of a current layout. The developer can create/save views and use them to navigate to a drawing.
vdViews is a collection that has vdView objects. The Document has a collection like this which is also serialized in vdml/vdcl format. The developer can keep the vdView objects that creates in this collection.
vdNamedUCS is an Object to create/save a named UCS in order to be used from the user.
vdNamedUCSs is the collection to keep vdNamedUCS objects which is serialized to the Document to vdml/vdcl files.
private void button3_Click(object sender, EventArgs e)
{
vdDocument Doc = vdFramedControl1.BaseControl.ActiveDocument;
Doc.New();
// create some 3D objects
Doc.CommandAction.CmdBox3d(new gPoint(0, 0), 3.0, 2.0, 1.0, 0.0d);
Doc.CommandAction.CmdSphere(new gPoint(5, 0), 1.5, 10, 10);
Doc.CommandAction.View3D("VISE"); // and set the VIEW
Doc.CommandAction.View3D("SHADEON");
Doc.Redraw(true);
MessageBox.Show("model created and set to a user view");
vdView view1 = new vdView(Doc,"MyView");
Doc.Views.AddItem(view1);
// set the view1 (MyView) to be as the current model view
view1.SetFromLayout(Doc.Model);
MessageBox.Show("view created, lets change it");
Doc.CommandAction.View3D("VWORLD");
Doc.CommandAction.View3D("HIDE");
MessageBox.Show("view changed");
Doc.Model.SetFromView(view1); // set the view back to (MyView) view1
MessageBox.Show("view changed to the saved state");
}
