Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
ahedley

Marionette Method SetLinksObjects()

Recommended Posts

What does the method SetLinksObjects() in the marionette node do? and under what circumstances do you use it?

Share this post


Link to post

SetLinksObjects() links the output geometry to the Marionette node so that if you were to re-run the network, the geometry previously drawn would get replaced with the newly drawn object(s). This is to prevent duplicate objects and allow easier updating if a user were to change a variable/parameter.

It's good practice to always use SetLinksObjects() when the node produces any sort of geometry.

I can try to explain further if need be.

Share this post


Link to post
SetLinksObjects() links the output geometry to the Marionette node so that if you were to re-run the network, the geometry previously drawn would get replaced with the newly drawn object(s). This is to prevent duplicate objects and allow easier updating if a user were to change a variable/parameter.

It's good practice to always use SetLinksObjects() when the node produces any sort of geometry.

I can try to explain further if need be.

@MarissaF: Yes - further explanation would be most helpful, maybe even a short tutorial.

I don't see 'SetLinksObjects()' on the standard Marionette node list (obviously), and a 'Search' on the Dev Wiki for 'SetLinksObjects' yields no results - so I'm not sure how anyone would know that it's good practice.

Is it something that is already coded inside the standard Vw geometry-producing nodes? Is it something that we need to add manually to any Custom geometry-producing nodes?

Thanks.

Share this post


Link to post

I don't see 'SetLinksObjects()' on the standard Marionette node list (obviously), and a 'Search' on the Dev Wiki for 'SetLinksObjects' yields no results - so I'm not sure how anyone would know that it's good practice.

You wouldn't! That's something we are trying to resolve.

With the advent of Marionette, users who would never have touched anything related to Vectorscript before are now diving right in, and with new eyes on it a lot of the weak points in documentation start to stand out. Many of the heavy scripting users here have been working with VS for decades and have developed their own best practices, but its about time we (Vectorworks) started making them more public and clearer.

The resources required for this are beyond my means to make many promises on, but I am pushing hard for an increase in this sort of documentation. The more the better.

Share this post


Link to post

@rDesign:

Currently, to my knowledge, all default content nodes that produce geometry have SetLinkObjects() specified.

If someone were to create their own custom geometry node, it is not *required*, but it's definitely recommended, because linking the geometry to the node that produces it will prevent duplicating the output geometry every time you run the network, and will also respectively update the output geometry each time you run the network.

Think of it this way - by using the SetLinkObjects(), each time you run a marionette network, all of the output geometry is erased/deleted, and everything is completely redrawn. Without the linking of the objects to the node, a part of the created object could be left behind.

I'll work on putting together a file that shows the difference when the SetLinkObjects() is used versus when it is not. I will also try to put together some useful knowledge for creating custom nodes, since it's apparent that there are some things missing from the public knowledge, and even my own still, from time to time.

Share this post


Link to post

Thanks MarissaF, that explains it better.

I thought I had noticed in playing around with some of the sample Marionette networks downloaded from the forum's Resource Sharing section that I did have to delete the output geometry before changing variables, otherwise you'd get multiple instances of the output geometry, exactly as you describe.

Any explanations and best practices for creating custom Marionette nodes would be most welcome. Thanks.

Share this post


Link to post

Thanks MarissaF, I somewhat suspected it had to do with object creation.

I know marionette was introduced with the notion that non programmers could get involved without programming. Maybe its the newness or the "star trek" feeling of going where no man has gone before but I need to ask - Are there other similar methods which can add functionality to marionette that you can briefly divulge?

Share this post


Link to post

I'll have to skim through my current resources and notes and see what I can put together.

I often come across things that I didn't already know and have to track down someone to help me learn what exactly certain lines of code will do, and unfortunately my desk is just covered in sticky notes about Marionette as a whole... I really should sort them out sometime.

But I definitely plan to compile a list of helpful information that isn't very intuitive to non-programmers!

Luckily, since I now help with developing new content, I should be able to help you and other users as I learn more on my own. :)

If you haven't looked at the Marionette Basics or Marionette - Implement a Node, these would be a great place to start while I poke around. There is a lot of information on the second link that will help to show some obscure tricks for custom nodes, although it's not extensive.

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
Sign in to follow this  

 

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.

×