BRX Opm Extension - how to have specific info about the custom object appear in the Property display

Hello again :+)

I gather the philosophy of the OPM Extension is to have the property values as members of the OPMExtension class, I notice in the Sample app these all seem to be hard coded values. How does one go about retrieving and displaying values that come from the Custom Entity itself? For example my entity has an Insertion Point, and I have added a Point Name (AcString - alphanumeric), a Point Number (unsigned int) - I would like to display these in the Property Palette. I have these values in the Custom Entity class because they need to be available for the WorldDraw function.

I am not sure, but does this have something to do with setting up a Data Dictionary or Extension Data? It's hunch at the moment - I will investigate that in the mean time :+)

I had thought about creating another class with an interface, that I could put this information into, then query it from within the OPMExtension class. But that could possibly be an extraneous way of doing things: I imagine there is some existing facility for doing  this.

Thanks again for any help :+)

Regards.

P.S I have made some progress in other areas - I added an Osnap point; My extra data is being written with Dwg In/Out and Dxf In /Out functions. The Application unloading is working now - not sure what I did at 2am the other day !

Comments

  • Dear David,

    your code can (and likely already does) register a so-called "client extension, providing the class descriptor of your custom entity;
    and then register some properties like the sample application shows.

    Then, the OPM manager will query your client extension, for any selected entity of your class, and for any registered property ...
    the sample uses "hard-coded values";
    but in your case, you can simply cast that entity (passed-in with the callback), and if it is of your class, then query your own object for the particular data, and assign the data to the provided variant instance :

    [code]
    AcDbMyPoint* pMyPoint = AcDbMyPoint::cast(pEntity);
    if (pMyPoint != NULL)
    {
        double myData = pMyEntity->getDouble();
        variantValue = myData;
        return true;
    }
    [/code]

    I hope this clarifies a bit ?
    many greetings !
This discussion has been closed.