Jump to content

Coding Your Nodes: Extending Marionette with Python

Recommended Posts

  • Vectorworks, Inc Employee

"Digital design consultancy firm Proving Ground demonstrates how to leverage the power of Vectorworks® software with Marionette, a Python-based visual scripting tool. Learn how to complete a complex surface paneling exercise, creating custom parametric controls, developing quantity reports, and creating compelling documentation from the results."

Video of the presentation:




Example file attached below.

Edited by JimW
Link to comment

WOW now your talking.

This is a great example of a lot of the things already in the current nodes and the more we learn how to use each node the more options we have.

This Webinar is at 2am for me so waiting in anticipation for the video and files.


Link to comment
  • 2 weeks later...
  • Vectorworks, Inc Employee

Additional Q&A Responses direct from Proving Ground:

Q. Could you be working from a NURBS surface or an interpolated surface as well as a loft?

A. Yes, it should work with any Vectorworks NURBS surface.

Q. How do you feel about the Marionette Wrapper node for "de-clutter"? Did you make use of them in your example?

A. Using the "wrapper" capability of Marionette is great, and a fantastic way to both simplify and break up strings of computations into more managable chunks. We didn't use it for this webinar, but highly recommend looking more deeply into them for your own use in the future.

Q. Based on your guys' first impression, would you evalaute Marionette as an equal contender to other products out in the market? Do you think an architecture student/professional would be ok using only VectorWorks for computational design?

A. This question was answered in depth in the webinar, and we'd recommend if you want to hear the full substance of it you check it out in the recorded version online. The short of it is that Marionette has a great number of valuable features - particularly with its integration with Python - that make it a valuable tool. This is especially true for current users of Vectorworks, who appreciate its capacity as a design and development platform that supports a full range of design and sophisticated representational capabilities. Of course, Marionette is also still a "young" tool, and so there may be some features that it does not yet have that other, more mature ones might, but as an overall framework, particularly in the context of a Vectoworks workflow, it has great potential.

Q. Is it possible to do object-oriented programming tasks such as recursion with Marionette/Python?

A. Yes, it is. The Python IDE for Marionette allows for you to either locally create classes, or even to load existing Python libraries. And of course, you can use any recursion strategy within each Python node.

Q. Could I build a node/wrapper that takes for example the midpoint of an activated object and then draws an object with this data?

A. The easiest way we found to integrate an existing Vectorworks object into Marionette is to reference it by name.

Q. How did you switch the grid type?

A. You can switch the grid type in the Vectorworks OIP for the panel component. There is combo-box that lets you select one of the two types.

Q. a) How do Marionette and Vectorworks handle large datasets? b) I have used other graphical programming languages in other applications and there have been functional limits to the sizes of data sets and complexity of the algorithm ---- in summary, they can get bogged down and it becomes more time-efficient to code the algorithm. c) it would be great if you could put together a webinar on how to build useful and efficient "compartmentalizations" and "hand-offs" for data models.

A. This is a great set of questions. The problem of managing large datasets is definitely a major one. You are likely to find similar bottlenecks in Marionette as you will find in other graphical editors, and indeed some problems you will probably find it easier and more efficient to directly "code" your way through (here the integrated Python IDE within Marionette may help you negotiate effectively between the visual and textual scripting environment). Depending on the complexity of your graph, one advantage you may find in Marionette is in developing strategies for using its "wrapper" capability for breaking up larger algorithms into more managable chunks. This webinar didn't talk about wrapping Marionette graphs, but it is one of Marionette's more useful and powerful features for simplification and deployment.

Q. Speed of execution becomes a problem with larger complex projects. If you have to go Python -> VS macro -> C++ core function for every operation, that could be slow - comment?

A. This is true. Depending on the number of operations (and number of objects being operated on) the length of computation can get quite long indeed. This questions is similar to the previous one, and has a similar answer. Key to all of these operations is how you set up your graph, and especially the strategies you use to sequence your computations. If you try to put all of your operations into a single graph, then the total amount of computation time (and also potential for bugs!) will increase significantly. It's good practice to break up graphs into workable "chunks" (with Marionette, especially using the "wrapper" approach).

Q. I can see in your example you have a 3d array of all the parts we need to build the surface.Next I want to see you put descriptions of one panel in the v.w. drawings that is buildable. Then I want to see you change the surface and show me the detail drawing can change automatically. is this do-able?

A. This particular workflow was not in the scope of this webinar, but it seems like developing this type of approach in a tutorial or webinar format would be a great "next step" for the Vectorworks and Marionette teams!

Q. Can you give one example of a relationship between a Python function and a VS function

A. We didn't use any VS functions directly as we evaluated Vectorworks and Marionette, but only the Python implementations. However, for writing in Python, we still referred to the VS documentation online, and found it to be no problem for us! It seemed to us that the VS functions mapped virutally identically to the Python format. By way of example, if you look at the panelization component in the Martionette file used for the webinar, you'll see that all of the NURBS surface functions are derived directly from the VS python library. To understand how all of these worked, we simply used the references from here: http://developer.vectorworks.net/index.php/VS:Function_Reference.

Link to comment
  • 6 months later...
  • 3 years later...

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.

  • Create New...