Writing OpenClip 'Macros'

While OpenClip was never intended to provide a macro language capability, if you are willing to make the effort, you can use OpenClip to 'write macros' for any program that supports OpenClip. To accomplish this, you will use the OpenClip Viewer and a way to generate OpenClip text files.

To do this, you need to reverse engineer the xml text files that are generated by Apple's NSDictionary in an OpenClip plug-in. Whenever you copy something in PowerCADD, the PowerCADD/WildTools OpenClip plug-in puts a copy of the drawing objects on the Pasteboard in OpenClip format, and it also writes out the drawing objects to the OpenClip path, which is

/Library/Application Support/OpenClip/OpenClip

The OpenClip Viewer reads the contents of this file. So your task will be to generate a text file that includes the drawing objects you want to copy into your CAD program, save it to the OpenClip path, click the Refresh button in the OpenClip Viewer to read in the objects and view them, and/or click on the Copy button in the OpenClip Viewer to copy the objects to the Pasteboard in OpenClip format. When you do this, the Pasteboard will then contain only the OpenClip objects so you can then Paste into your CAD program.

You will want to proceed slowly and very carefully, making one small change at a time to insure that your text files are acceptable to the NSDictionary in the OpenClip Viewer as there are no debugging tools available and frankly we don't have a clue what will happen if you get something wrong or how to help anyone. In short, you will be on your own here.

You can generate the required text in Excel, or with any programming environment that will write out a text file. That would include Real Basic, Visual Basic, Visual C++, database programs such as Panorama or Filemaker, or scripting languages. However for most people, Excel will be all you need.

To get you started, you may want to take a look at the enclosed Sparkline Generator spreadsheet created by Derek Dubout to generate a polygon for a chart. It is unfinished and depends on copying the resulting text into the text file at the OpenClip path with a text editor. But it should get you started with the idea.

 

Polygon Generator

The Polygon Generator spreadsheet was cobbled together in about 10 minutes to show Matt a concept. It doesn't automatically generate the final OpenClip text, and you have to copy and paste the cells from one sheet to another. It really isn't anything more than initial scribbles on a piece of paper that one might do at a dinner party to help show an idea. So, it is just a conceptual thing at this time.—Derek Dubout

Annotated Defines

This file would be helpful to anyone who might be considering working with the OpenClip macros, I took the header file and added text from the Sample files, and annotated it as best as I could, so I could reverse-engineer things. I think this gives an accurate template for the object types and format for stipulating attributes.—Matt Arnold

   

OpenClip  Viewer  Files  Paste  Copy  Marketing  Consortium