mark's banner

Wednesday, June 02, 2004

Combine Locate And Primitive Interfaces

I realized recently that maybe I don't have to build my own locate tools in VBA. Here's the tip.

Instead of rolling your own locate logic into a primitive command interface build a locator interface to locate an element, save the element globally in a public variable. Do this in the locate filter. And on accept call a primitive command that implements the primitive interface to draw new elements based on the original.

I did this recently. Upon locating the element, a cell I saved it globally and then called a primitive command to draw new elements. These elements were then added to a new cell, along with elements from the original cell. When the primitive command is finished instead of

CommandState.StartPrimitive Me

do

CommandState.StartLocate New classTheLocateClassModule

This will allow you select another element just like a MicroStation edit command would allow you to do.

0 Comments:

Post a Comment

<< Home