Jump to content
Developer Wiki and Function Reference Links ×

Custom Data Bar


JBenghiat

Recommended Posts

Thanks @Maarten DE, using CParametricCustomBar was quite useful. Vectorworks was hanging when I used the ISDK calls, and the VWPluginToolCustomBar class seems to require first initializing an array of CustomBarRefID's, which is a bit confusing.

 

I have everything working, except that the very first time I run the tool each session, the data bar is blank.

 

I was also hoping to use SetDataDisplayBarField to automatically handle certain data types, but that didn't seem to work for me.

 

For a custom tool, I'm calling the create and install commands from PointAdded(). I'm overriding the OnCustomBar_ methods for setup, update, lock, and unlock.

    if ( this->GetToolPointsCount() == 1 ) {
        if ( fCustomBar.GetCustomBarID() == 0 ) {
            fCustomBar.Create();
            fCustomBar.Install();
        }
    } else {
        fCustomBar.Release();
    }

 

Link to comment

A sample in the SDK that uses normal and dynamic control points and a custom data bar would be very usefull imo. And maybe even a Reshape tool overwite too. Now it's just way to much trail and error to get something to work.

 

Where are you creating your dynamic ctrl Pts? I create mine in VWParametric_EventSink::Recalculate() and everywhere where I read the object's parameters. I use gSDK->CustomObjectControlPtSet().

 

The custom Data Bar, I create it in VWParametric_EventSink::OnCursorEvent().

 

But again, I'm far from having a perfect working version myself...

Link to comment

I also create the control points in the recalculate event sink, and have a method that uses CustomObjectControlPtSet() to create all the control points. I have an enum defined for all the control point IDs.

 

I'm using an implementation of IProviderCursorHandles to handle the control point actions, as well as set custom tool tips and images.

 

Ended up creating a child class of CParametricCustomBar that has methods for setup, update, lock, and unlock, so I could easily use the same custom bar for the insertion tool and control points. In both cases, I'm not seeing the custom bar the very first time in a Vectorworks session. For control points, I only see the custom bar in 2D views. I tried installing and releasing the custom bar during the constructor, but that doesn't help. Otherwise, everything is working as expected.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...