Jump to content

ImageControl2 - Modern Dialogue

Recommended Posts

Greetings all, I'm trying to wrap my head around, showing an image in dialogue.


I see this function call:

def vs.CreateImageControl2(dialogID, controlID, widthInPixels, heightInPixels, imageSpecifier):
    return None

..but can't get it to work. The issue is with the 'imageSpecifier' parameter.


Looking at other posts, https://forum.vectorworks.net/index.php?/topic/41757-2014-script-will-not-run-in-2015/&do=findComment&comment=209508


@klinzey instructed the use of a folder named _some_name.vwr, with your image in there, and use that path for the imageSpecifier. However, what if you want your image structured down the folder channel the same way your plugins are structured. Eg

|-- Roaming
|---- Nemetscheck
|------ Vectorworks
|-------- 2016
|---------- Plugins
|------------ TuiPlugins
|-------------- PluginImages
|----------------| rectange.png
|-------------- Rectangle.vso

full_image_path = "TuiPlugins\PluginImages\rectangle.png"

def CreateDialog():
	-- vs.CreateResizableLayout(etc,etc..)
	-- vs.CreatePullDownMenu(etc,etc..)
	-- vs.CreateEditText(etc,etc..)
	-- vs.CreateImageControl2(dialog, k_image , 200, 200, "{}".format(full_image_path))

can this be done? Or does the folder have to have the .vwr characters appended to it? And can the location of this *.vwr folder be placed further down?


Hope this makes sense :D


Share this post

Link to post

hmm, strange, full path name worked.. just got my seperators wrong, should've used forward slashes(/) instead of backslashes (\)

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.