Before you start work on doing an OpenClip Copy operation, it's a good idea to first stop and think this all the way through.
In PowerCADD, we have a 2D program but we also have topography tools that provide an optional Z height. In a normal Copy operation in PowerCADD, this is all about copying 2D geometry, and it would confuse users if some objects came across with a Z height. So the standard behavior of the PowerCADD/WildTools OpenClip plug-in is that it ignores the Z height for all objects. Everything ends up in the 3D program at the same, zero height.
We also have within TopoTools the ability to copy topo contours and 3D surfaces directly from the tool dialogs, with OpenClip Copy buttons and menus. So we can go from this in TopoTools...
To this in FormZ...
Or copy 3D surfaces...
where elevations above sea level are brown, sea level is blue, below sea level is dark blue and green when crossing from below to above sea level. That's where green moss and seaweed grows on rocks.
And we also have the ability to press the Option key while choosing Copy to do a 3D copy operation, where all Z heights are recognized.
Now for a 3D modeling program, it's worth remembering that OpenClip is really only suitable for basic drawing geometry, so any 3D view with all of the shading and texturing cannot be handled by OpenClip, nor should it. This capability is easily handled by PDF, so we probably want to concentrate on basic geometry.
It's pretty standard that integrated 3D programs can automatically produce 2D orthogonal drawings from the model, sometimes of a section, sometimes a three-view with a 3D view of the part. There are lots of different ways to do this, and probably users will want to go from the 3D model to a 2D drawing in some form.
To do an OpenClip copy, you run through your drawing, building an NSDictionary and then add it to the pasteboard. As a guide for how to do this, download:
This is the class that is used in the PowerCADD/WildTools OpenClip plug-in. We've made no effort to cut it down or to simplify it, but you should be able to find your way through it reading the notes included as comments.
The PowerCADD/WildTools OpenClip plug-in also does a 3D copy where the optional Z heights and two types of topographical survey point objects are handled. This is handled in this class:
Which is called by this:
This is called by an event handler put on the Cut and Copy commands in PowerCADD.
As you can see in CopyJob above, the PowerCADD/WildTools OpenClip plug-in the CopyJob puts the NSDictionary on to the pasteboard as an OpenClip flavor, and also writes out a file to the OpenClip path. This lets you watch what is happening behind the scenes and to look at whatever you just put on the pasteboard. This is how we created all of the OpenClip test files.
If you do this in your OpenClip copy, then it also means that you can use the OpenClip Viewer for testing. A program typically writes multiple flavors to the pasteboard, and to test your OpenClip copy, just click on the Copy button in the OpenClip Viewer to put this on the pasteboard, all by itself.
When you get this done in your program, please send us a note so we can include your program in the OpenClip 'consortium'.