Jump to content
Developer Wiki and Function Reference Links Read more... ×
michaelk

Picking symbols

Recommended Posts

I'm working on a tool that uses 4 different symbols as components.

 

Currently I'm specifying the symbol as a text field in the OIP.  Not the most elegant solution.

 

I don't recall seeing another tool that lets you get to a symbol picker from the OIP.  And I haven't run across a VS way of building a Settings… dialog.

 

Is it possible to create a simple symbol picker in the OIP?  Or from a preference in the mode bar?

Share this post


Link to post

Sure: http://developer.vectorworks.net/index.php/VS:vsoButtonGetResource

 

The object has to be event and custom widget enabled. 

kWidgetResourcePopup = 107

 

Mode bar options are a bit of a challenge in vs, but it is possible: http://developer.vectorworks.net/index.php/VS:vstResPDMenuInit

 

The OIP resource popup is somewhat limited in VS. If you want more complex behavior, use a button to launch a dialog with a resource picker.

Share this post


Link to post

Thanks, Joshua.  That is super helpful.

 

So vsoButtonGetResource creates a button in the shape pane of the OIP?  Like the Settings… button on a door or window object?   How does it know where to put the button in the OIP? (he said without reading up on it).

 

There goes my free time for a while.  

Share this post


Link to post

No, vsoAddWidget or vsoInsertWidget adds the widget to the OIP. vsoButtonGetResource is what you call in the button handler to raise the resource picker. You specify the parameter that actually stores the name of the resource.

Share this post


Link to post

Do you need to see the graphic of the symbol? If not, why not just add the symbol name to a popup parameter.

I have not used vsoButtonGetResource because it is only available from VW 2018. I created the following dialog in 2014, Select Sign Legend, which would be similar to that. The dialog is activated by clicking on the OIP LEGEND button and the selected sign is store in the Sign Type parameter. Other parameters get their value from the record attached to the symbol.

 

screenshot.1.thumb.jpg.53044bbf1ed3edc242bca23b4f5b6ef3.jpg

 

The following is a variation of the same idea but the dialog has a tree picker control instead. I created this plugin to scale symbols before the capability was added to symbols.

screenshot.2.thumb.jpg.0514b1243edf8d6fc75c9a93eaadc0eb.jpg

 

  • Love 1

Share this post


Link to post

Miguel

 

That is really cool.  It makes me think about a lot of things…

 

In this case I need to be able to make new symbols on an ad hoc basis.

 

But wow.  That is cool!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

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.

×