Share
 
 

Follow AcEdInputPointFilter Etiquette

Level

Suggestion

Applies to

ObjectARX and .NET applications

AutoCAD recognizes only one instance of AcEdInputPointFilter at a time. When more than one application needs to use the filter at a given time, the order in which the filters are processed is significant and can cause errors in one or both applications.

If you find that your application must register a filter when another is already active, follow these suggestions:

  • Limit usage of this slot to the context of modifying the point or tooltips string, so that all applications can use their filters with a minimum of conflict or extraneous processing. Remove your filter, and replace it with a monitor in as many execution contexts as possible. Use AcEditorReactor and AcEdInputContextReactor to determine when the contexts are relevant to your application, and register or deregister as appropriate. In AutoCAD Quiescent mode, use a monitor until it detects conditions in which your application would act. Then queue up a registered command from your application, and trade your monitor for a filter after it is executed.
  • Have your filter implementation follow these conventions:
    • Register the filter class with AcRx and start the class name with an optional unique prefix.

      The filter class should also define an APP string with a viable "product info" portion of the app name, by defining the class static member void rxInit() to pass the string via the appName parameter of newAcRxClass().

    • Supply explicit logical application name and product information elements in the application name. Implement and document a user interface for disabling your application's point filter, even if it means suspending all or part of your application operation. This will allow applications with non-integrated filters to operate safely and independently of one another.
    • Document the user interface, preferably indexed in a form that includes the string "point filter."
  • If two applications regularly or systematically conflict with each other in point filter usage, try to integrate the behavior of the point filters to satisfy both applications.
  • If you and another application developer determine that your filters (ADSK_Filter1 and WXYZ_Filter2 in this example) can peacefully co-exist, and which should take precedence over the other, then follow the steps listed below:
    • Obtain the pointer to the existing filter (say, ADSK_Filter1).
    • If it is a filter you can chain, then revoke it, register your own, and pass the output of your filter (ADSK_Filter1) into the other filter (WXYZ_Filter2).
    • Or, pass the input to your filter (ADSK_Filter1) into the other filter (WXYZ_Filter2), and process its outputs as if they were the original input values.

The sequence in which the filters are called determines which filter has precedence over the other.

Another way to resolve a conflict between two filters is to defer to one filter on the operating context. Or, you can devise your own protocol for filter classes to communicate with each other. When in doubt, contact Autodesk Developer’s Network as to the proper procedure.

You should revoke an unfamiliar input point filter only as a last resort. Each filter gets a callback when it is revoked. If this happens to a filter at an unexpected time, it can take evasive action, such as alerting the user to the fact that its operation is being changed (possibly offering the chance to restore it later) or even quitting AutoCAD.

Was this information helpful?