60000582 Support of Views and NamedUCS

Article 60000582
Type Wish
Product Engine
Version 6016
Date Added 7/22/2008
Fixed (9/2/2009)
Submitted by Thomas Schmitz


Support of NamedViews and UCS


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.

See a sample code on how to use vdView/vdViews :
private void button3_Click(object sender, EventArgs e)
    vdDocument Doc = vdFramedControl1.BaseControl.ActiveDocument;
    // 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
    MessageBox.Show("model created and set to a user view");
    vdView view1 = new vdView(Doc,"MyView"); 
    // set the view1 (MyView) to be as the current model view
    MessageBox.Show("view created, lets change it");

    MessageBox.Show("view changed");
    Doc.Model.SetFromView(view1); // set the view back to (MyView) view1
    MessageBox.Show("view changed to the saved state"); 

Send comments on this topic.