Jump to content

Setting Sheet Layer Sheet Title

Recommended Posts

I'm attempting to make some nodes for interacting with a Sheet Layer's Sheet Title. I've been able to make the Get Title function work correctly (Although this does also grab the Sheet Number- any way to avoid this outside of scripting its removal?) but I can't seem to get the the Set function to work. I've also tried to just replacing the variable I've created with a string value without success.  Here's the code as I've cobbled together and VWX is attached. Sheet Layer Marionette.vwx

class Params(metaclass = Marionette.OrderedClass):
	this = Marionette.Node( 'Set Sheet Layer Title' )
	this.SetDescription( 'Retrieves the sheet title from a sheet layer' )

	#Input Ports
	obj = Marionette.PortIn(vs.Handle(0), 'hLayer')
	obj.SetDescription( "The input layer object")
	string = Marionette.PortIn( '[Sheet Title]', 'sTitle' )
	string.SetDescription( 'The sheet layer title' )
	#OIP Controls

	#Output Ports
	layer = Marionette.PortOut('hLayer')
	layer.SetDescription( "The handle for the layer" )

def RunNode(self):
	x = self.Params.obj.value
	title = self.Params.string.value
	vs.SetObjectVariableString(x, 162,title)


Share this post

Link to post

Continuing to mess around with this- I did find that using int 159 is actually the better usage for the Get function to retrieve just the Title without the Number. Doesnt seem to do anything to help the Setting problem.

Share this post

Link to post

...Or using 159 does in fact work. Not sure what I did incorrectly the first time, but it's working now after another attempt. Love it when I solve problems by opening and closing the program...

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.

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