Yaro Posted August 6, 2025 Share Posted August 6, 2025 Hi all, I'm relatively new to working with Marionette in Vectorworks, but I'm looking to create a script that will automatically generate a 3D model when I draw a polygon on a specific layer. What I'm trying to achieve: Whenever I draw a polygon on the layer ‘detached house’, it should immediately create a 3D building with the following specifications: - 2 floors of 3 meters each - A pitched roof (1.5 meters high) - The roof should slope along the length of the building So ideally, the Marionette script would detect the polygon on the right layer and directly generate a full 3D object with these parameters. Has anyone here done something similar, or could point me in the right direction? Example scripts or hints would be greatly appreciated! Thanks in advance Quote Link to comment
the frog Posted August 6, 2025 Share Posted August 6, 2025 Hello This is what you get 2 floors and the roof. Of course it's possible to fill the roof. The easy way is to send a vw file with the result you want. This way it's possible to help. Quote Link to comment
Yaro Posted August 7, 2025 Author Share Posted August 7, 2025 16 hours ago, the frog said: Hello This is what you get 2 floors and the roof. Of course it's possible to fill the roof. The easy way is to send a vw file with the result you want. This way it's possible to help. Hi, Thanks so much for your response! Yes, something like what you showed would be perfect. I’ve attached a file containing the different housing types and the standard building forms. A few important details for the script logic: I draw a 2D polygon on a specific layer, for example “detached housing”. When I run the script, a 3D model is generated based on the polygon’s footprint (length and width), with the following structure: - 2 floors, each 3 meters high - A pitched roof, sloping along the length, and 3 meters high - So for example, if I draw a polygon of 3x6m, the building should also be 3x6m at the base, with the height automatically generated based on the above logic. The script should read the active layer to determine the housing type and generate the correct 3D form accordingly (e.g., apartments vs detached housing). Does this make sense? Thanks again for your help! Document with standard 3d models of housing types.vwx Quote Link to comment
the frog Posted August 7, 2025 Share Posted August 7, 2025 Got the idea You spoke about polygons, are they all four sided or rectangle only? Do you want to see the separation between the floors? Do you need to choose with or without roof? In you first post you said the roof was 1,5m now the high has to comply with the number of floors (1 level 1,5m 2 levels 3m etc…), or do you want to be able to specify the roof high? Only the first questions before writing the script Quote Link to comment
Jonathan Pickup Posted August 7, 2025 Share Posted August 7, 2025 this might help Quote Link to comment
Yaro Posted August 8, 2025 Author Share Posted August 8, 2025 13 hours ago, the frog said: Got the idea You spoke about polygons, are they all four sided or rectangle only? Do you want to see the separation between the floors? Do you need to choose with or without roof? In you first post you said the roof was 1,5m now the high has to comply with the number of floors (1 level 1,5m 2 levels 3m etc…), or do you want to be able to specify the roof high? Only the first questions before writing the script - Yes, I'm currently using rectangles only, but it would be helpful if polygons were supported as well, since sometimes an apartment block might need to have a special corner or shape. - Yes, please. - Not really. I mean, in the future it would be nice to have the option to choose which types of roofs can go on which buildings, but it will take me some time to figure that out. And for now that isn't important. If you could help me with the basics in the meantime, that would be incredibly helpful. - No, that was my mistake, the roof should be 3 meters. Eventually, it would be great to have the option to adjust the roof height, but that’s not a priority right now. Quote Link to comment
Yaro Posted August 8, 2025 Author Share Posted August 8, 2025 11 hours ago, Jonathan Pickup said: this might help Thanks for your reaction, Jonathan! That’s essentially what I need. However, I’m looking for a script that can do multiple houses at once, each with different diameters. It’s just way more efficient to do it through a script. (which I haven’t been able to figure out yet on how to do that) 🙂 Quote Link to comment
Tom W. Posted August 8, 2025 Share Posted August 8, 2025 2 minutes ago, Yaro said: Thanks for your reaction, Jonathan! That’s essentially what I need. However, I’m looking for a script that can do multiple houses at once, each with different diameters. It’s just way more efficient to do it through a script. (which I haven’t been able to figure out yet on how to do that) 🙂 Another option is Create Objects from Shapes... > Massing Model. Will create multiple buildings at once based on the selected polygons + the height/roof/floor parameters you tell it to use. Quote Link to comment
Yaro Posted August 8, 2025 Author Share Posted August 8, 2025 2 hours ago, Tom W. said: Another option is Create Objects from Shapes... > Massing Model. Will create multiple buildings at once based on the selected polygons + the height/roof/floor parameters you tell it to use. Hi Tom, Thanks for your response. This will definitely be helpful to get started. However, my ultimate goal is to develop a script that allows for quicker adjustments by simply placing objects into the correct layers. For example, detached housing would be organised into multiple layers based on roof types, which I could then easily modify. I believe this could work using "Create Objects from Shapes," but I still feel there might be a more efficient way to handle it with a script. That said, I might be wrong. 1 Quote Link to comment
Tom W. Posted August 8, 2025 Share Posted August 8, 2025 Just now, Yaro said: However, my ultimate goal is to develop a script that allows for quicker adjustments by simply placing objects into the correct layers. I hear you 🙂. Sounds very cool good luck! 1 Quote Link to comment
VIRTUALENVIRONS Posted August 8, 2025 Share Posted August 8, 2025 I have been watching this thread. House from polygon tweaked my interest, but I am not a Marionette person. But, if I had to do something like this "old school" I would use the Multiple Extrude tool. Perhaps instead of a polygon house, a polygon(S) house would be easier to script. See below for an example of how I would do this. Quote Link to comment
the frog Posted August 16, 2025 Share Posted August 16, 2025 (edited) Hello Thanks to Marissa (the copyName problem), after digging into your question, here is a possible solution. In the VW network, you have the developed script (to see the way it’s built) and the enveloppe one. The script works with rectangles and 4 sided polygons. I kept your layers names and added a “specific“ one where the script is written. 1- To make the script work you need to choose the layer you want the building to be. THE LAYER DEFINES THE NUMBER OF FLOORS AND THE TYPE OF HOUSING. 2- Second you draw your e.g: rectangle where you want it on the plan. 3- You give a name to the rectangle (bottom of the OIP) 4- You run the node. A dialog box will open where you copy the name you gave to your rectangle 5- Magic it returns a 3d model with the parameters (number of floors, roof type, layer) you asked in your post. 6- If you are in a different layer when you draw the rectangle and change the object layer, the result will be seen on the chosen layer AND will become the active one. 7- If you copy a 3d group, its name will increase by one. Remember that a name is unique in VW never give twice the same name or it will return the Marionette node number If you are not happy with the ceiling high (now 300 cm) dig in the script, the “real”node name is “ceiling hight”. If you want to change the number of floor parameters e.g: a “Detached house is built with 2 stories you need to change at the beginning of the scrip the “param” value AND open the “floor_number_decision” enveolppe node to modify inside the chosen layer enveloppe node, the “int” number (number of floors, always smaller or equal to the “param”). For the name buildings and shapes I choose, you might recognize the Hague addresses (thanks to Google earth)☺️ building by layer V1.vwx Edited August 16, 2025 by the frog Quote Link to comment
the frog Posted August 18, 2025 Share Posted August 18, 2025 Here is a debugged version (false 2d restitution) + the "terrasse" roof added. This version allows you to choose in the OIP, the ceiling high, the roof typology, and the numbers of level before the object is considered apartments with no roof. There is still a bug with the double roof, it won’t take the attribute and stays colored (VW mystery). The Enveloppe node won’t return the 3d name, that’s why you have the last node attached. If you run the developed script, once you’ve put back in the last node, it works. buiding by layer V2.0.vwx 1 Quote Link to comment
Yaro Posted August 18, 2025 Author Share Posted August 18, 2025 Hi the Frog, This is amazing!! I'm so happy with this and how it works. Thank you so much :)) It exceeds all expectations! Quote Link to comment
the frog Posted August 19, 2025 Share Posted August 19, 2025 (edited) Last version 2.1 Added the multi polygon option. You can choose the roof slope in ° If you want to add a layer look inside the "floor_number_decision" node once you've created your layer buiding by layer V2.1.vwx Edited August 19, 2025 by the frog 1 Quote Link to comment
Recommended Posts
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.