Jump to content
JBenghiat

Custom Data Bar

Recommended Posts

Does anyone have any advice or examples for creating a custom data bar? I can't seem to figure out the right place to call CustomBarCreate() and CustomBarInstall().

 

 

Share this post


Link to post

I'm using the CParametricCustomBar class as Hippocode suggested, and it seems to work. I still have some issues with it though, I have to tackle them later when I have more time.

Share this post


Link to post

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();
    }

 

Share this post


Link to post

And I seem to be experiencing the same thing with control points — the first click in a Vectorworks session, and the custom bar does not load, but functions as expected after that.

Share this post


Link to post

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...

Share this post


Link to post

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.

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...