• Announcements

    • JimW

      The Future of Algorithmic Design   05/23/2017

      Natively available within Vectorworks software, Marionette delivers an algorithmic means to orchestrate and dictate design forms and customizations without needing to be a programmer.   Let the Marionette collaboration begin. Watch this video to learn how you can upload and share Marionette objects, nodes, and networks with your peers.
ChadL

Create Classes

16 posts in this topic

I'm not a scripter, and in my limited research I was not able to successfully do this. I want to create a tool (marionette node, vectorscript, anything) that when I run it it will create a series of classes in the active document. I know what I want all those classes to be, just don't know how to make this script.

 

Thanks,

 

0

Share this post


Link to post
Share on other sites

You don't need a script, you just need a resource.

 

Create a file with all of the classes you want. 

Create one object in each class. This could be something big or even just a locus. It actually does not matter if you have more than one object in each class, just that there is at least one in each class.

Select all of the object and Create Symbol. Name it something like "Create Class Set 1"

Store the symbol in your symbol library.

 

When you want the classes imported into the file, just go to the library and import the symbol. Any classes that do not already exist in the file will be created.

 

Of course if you want to learn scripting this could be scripted, but if you just want the end result, this will be much faster than debugging a script. If you do want to learn scripting just say so and we will give you a starting point.

0

Share this post


Link to post
Share on other sites

HI Pat, thanks for the reply. I have done the resource before, I was using this as a project to start learning scripting.

 

Thanks, 

 

0

Share this post


Link to post
Share on other sites

OK.

 

Here is the outline that you need to do this in Vectorscript. Just add NameClass lines as necessary. Ask again if you need more help.

 

Procedure Create_My_Classes;

Begin
	NameClass('MyFirstClass');
End;

Run(Create_My_Classes);

 

0

Share this post


Link to post
Share on other sites

And here is a way to do it in Marionette.  By wiring each String node to the Dummy End node, you make the whole thing into a single Network that can be run at once. You could Wrap the entire network into a single Node and then save that as a symbol (with Convert to Group checked so it comes back into the drawing as a node that can be run). The class names are typed into the Resouce Browsers for each String node.

 

0

Share this post


Link to post
Share on other sites

@ChadL

It looks like @Pat Stanford's post doesn't include the Marionette file, so I'm attaching my example here. For each class you want to add to your document, you would define the name in the OIP when a String node is selected.

There are many other ways to define the list of names for your classes, but this is the most native. It's also possible to read them from a text file, or you could prompt the user for the names.

 

In 2018 Marionette can create Menu Commands, which I think would also be useful; say you knew you would be using these classes in various projects but didn't want to create a template file. You could store this Marionette Network as a Marionette Menu Command and access it in whichever document you want to add the classes to.

 

Please let me know if you have any questions.

Marionette_CreateClasses.vwx

0

Share this post


Link to post
Share on other sites

There was a screen shot attached when I posted it :-( Here it is now.

 

@Marissa Farrell solution is much more elegant, but I think both ways show useful information about using Marionette.

 

Screen Shot 2017-10-11 at 8.13.30 AM.png

0

Share this post


Link to post
Share on other sites

Thanks, this is super helpful. I played around with this for about 30 minutes yesterday, making me excited again to try to learn marionette.

 

0

Share this post


Link to post
Share on other sites

Okay, I've been playing with this and I like it. However, now that I got a taste, I want to go deeper. I have been struggling to create a class and assign it line colors and fill colors without having an object to pull that info from. I think the problem is in how I am compiling my RGB values. Right now I have 3 int nodes with my RGB value, then I've tried using a series node, or an ordered list. Nothing I've done so far sets a color.

0

Share this post


Link to post
Share on other sites

A little trick, use the Vec 3D or 3D Vector node for your RGB values.

 

EDIT: Vector, not Point.

0

Share this post


Link to post
Share on other sites

I've tried that too. I have 3 int nodes feeding a 3d point node, feeding a set pen color node. AAhhhhh, that is probably the problem, i used 255

 

Edited by ChadL
0

Share this post


Link to post
Share on other sites

Here is what I currently have. the only Int with a value higher than 0 is the bottom one, which is set to 65535

 

 

Screenshot 2017-10-16 11.08.06.png

0

Share this post


Link to post
Share on other sites

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