DomC Posted September 17, 2015 Share Posted September 17, 2015 (edited) Places a Marionette object, which contains symbols from a specific symbol folder. Offset and rows, can be defined. handy for a quick and printable preview of symbols in a specific folder. Edited September 17, 2015 by DomC Quote Link to comment
Mark Flamer Posted September 17, 2015 Share Posted September 17, 2015 This is a great example of a simple "Bread and Butter" script as I like to call them, a script that automates a simple day to day task and saves the user a few minutes. Most people think of flashy, curvy geometry when you mention graphical scripting. I think the fact that Marionette is integrated into VW and allows these day to day tasks to be automated is really useful. Thanks for sharing. Quote Link to comment
rDesign Posted September 17, 2015 Share Posted September 17, 2015 Thanks DomC, this will be handy. Quote Link to comment
beuysgroup Posted April 11, 2016 Share Posted April 11, 2016 This is really handy and i use it a lot. I also want to modify this, so that it will insert all symbols, not only one folder at a time. However i can´t find a way to do this. Anyone got any ideas? Thanks! Quote Link to comment
DomC Posted April 12, 2016 Author Share Posted April 12, 2016 #python code. Copy this in your existing node. It just lists ALL Symbols without caring about symbol folders. Like always whithout warranty. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( "InsertAllSymDefinitions" ) this.SetDescription( 'Shows all Symbol definition' ) offset = Marionette.PortIn( (1), "offset" ) offset.SetDescription( "offset of columns and rows" ) columns = Marionette.PortIn( 4 ) columns.SetDescription( "Number of columns" ) angle = Marionette.PortIn( (0) ) angle.SetDescription( "angle" ) symbols = Marionette.PortOut() symbols.SetDescription( "the created symbol preview" ) this.SetLinksObjects() def RunNode(self): versatz = self.Params.offset.value spalten = self.Params.columns.value angle = self.Params.angle.value x=0;y=0;zeile=0;c=1 symnames=[] res_list,num_items=vs.BuildResourceList( 16, 0, '') for i in range(num_items): res=vs.GetResourceFromList(res_list, i) if res !=vs.Handle(0): t=vs.GetType(res) if t ==16: symnames.append(vs.GetName(res)) #vs.AlrtDialog(str(symnames)) for n in symnames: vs.Symbol(n,x,y,angle) vs.Locus(x,y) x=x+versatz zeile=int(c/spalten) y=zeile*versatz if c % spalten ==0: x=0 c=c+1 self.Params.symbols.value = vs.LNewObj() Quote Link to comment
Sebastian Giese Posted July 24, 2023 Share Posted July 24, 2023 Hi @DomC, ich habe diesen Code eingefügt, leider ergibt der Node keine Symbole... Ich komme leider nicht drauf wieso das nicht funktioniert? @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( "InsertAllSymDefinitions" ) this.SetDescription( 'Shows all Symbol definition' ) offset = Marionette.PortIn( (1), "offset" ) offset.SetDescription( "offset of columns and rows" ) columns = Marionette.PortIn( 4 ) columns.SetDescription( "Number of columns" ) angle = Marionette.PortIn( (0) ) angle.SetDescription( "angle" ) symbols = Marionette.PortOut() symbols.SetDescription( "the created symbol preview" ) this.SetLinksObjects() def RunNode(self): versatz = self.Params.offset.value spalten = self.Params.columns.value angle = self.Params.angle.value x=0;y=0;zeile=0;c=1 symnames=[] res_list,num_items=vs.BuildResourceList( 16, 0, '') for i in range(num_items): res=vs.GetResourceFromList(res_list, i) if res !=vs.Handle(0): t=vs.GetType(res) if t ==16: symnames.append(vs.GetName(res)) #vs.AlrtDialog(str(symnames)) for n in symnames: vs.Symbol(n,x,y,angle) vs.Locus(x,y) x=x+versatz zeile=int(c/spalten) y=zeile*versatz if c % spalten ==0: x=0 c=c+1 self.Params.symbols.value = vs.LNewObj() Quote Link to comment
DomC Posted July 24, 2023 Author Share Posted July 24, 2023 Oh, this is an old code and not very nice one. Without testing: 1. The vs.GetType should replaced by: vs.GetTypeN(res) 2. The node returns not the Symbol Name. That means the node itself insert the Symbol. In fact it looks, like the output just returns the last inserted symbol. Which means the node should insert the symbols in the number of rows and should do the job but not returning the resulting symbol handles. With that node, you can't use the output useful disconnect symbol node and print debug node. 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.