Jump to content

DomC

Member
  • Posts

    605
  • Joined

  • Last visited

Everything posted by DomC

  1. It is possible to do this with a script call in in the Workseet. =RUNSCRIPT('Script-1', A4, B4) The Script (Make a new Script in the Ressource Browser Named "Script-1" Switch to Python Script): sym_name_old=vs.WSScript_GetPrmStr(0) sym_name_new=vs.WSScript_GetPrmStr(1) sym=vs.GetObject(sym_name_old) vs.SetName(sym, sym_name_new) vs.WSScript_SetResStr(sym_name_new) If you want to do this in a Symbol-List Worksheet. You can't write lines to that list. So you have to make a Record Format. Which you can edit in the List. And The Script will rename the Symbol with that Record Entry
  2. Hi Carl I made an example. Attached to this post. Hope, It can help you finish your project. Code in the Worksheet: =RUNSCRIPT('Script-1', A2, B2, C2, D2, E2) Code of the Script i=0;arg_len=1;args=[] while arg_len >0: arg = vs.WSScript_GetPrmStr(i) args.append(arg) arg_len = len(arg) i=i+1 vs.WSScript_SetResStr(str(args))
  3. Hi I think, we have to specify the args in the worksheet scripts. Like this arg1=vs.WSScript_GetPrmReal(0) arg2=vs.WSScript_GetPrmReal(1) I tried to get all args with a while loop args=[];i=0 while vs.WSScript_GetPrmReal(i) !=None: #Endless loop, attension! args.append(vs.WSScript_GetPrmReal(i)) Don't try this. You will never be able to open your document again. Because Worksheets script automatically actualize at open document (which seems to be a nice feature ...) but If you have an endless loop in your script you will have to wait endless :-) Or maybe it's because the vs.WSScript_Get******* ist not very liberal, if you get wrong value type. A String instead of a float as example?
  4. OK, forget my comment about your args. I thought you want to have access to the sys.argv command line arguments.
  5. DomC

    Node Question

    Tim, you are right. Thanks for this good idea. There can be used search-tags, to find the requested nodes with cached index ( in real-time speed), very exciting ...! If we look at the left menu, there is a possibility to access the Vectorworks Service Select Content. But it will be still some work necessary from Vectorworks Inc. to collect, sort out, provide, put it on the server and manage this contents. I think local distributors could make this with their own content management. There is a good chance the pain of searching the community board for marionette ressources can have an end soon :-)
  6. Do you want get the output in your OS Terminal or somewhere out of Vectorworks? That is to high for me, but I am very interested on this possibilities too. As I suppose, that the args method is not loaded in an embedded python. So maybe we have to somehow initialize this first. But as I told, this could be a very dilettantish comment.
  7. DomC

    Node Question

    And we all know, there always is a lake of girlpower (manpower). Someone had to copy/paste (I think this is allowed since the beginning of Software-engeneering :-), judge and coordinate the Node content. That costs time but it will be worth ... I just see, that we have a really potential tool and it has so much natural advantages compared to competitive software (It is totally integrated, no separate tool and acess to the complete BIM Objects and Record). Vectorworks you are in front! Just lap them for once.
  8. DomC

    Node Question

    A Rectangle-Node, which has nearly the same capabilities like the rectangle tool users already know. Also it supports angle input and calculates edge-points to insert edge points. So many enhanced nodes are available here on the community-board. Will they find a way into the standard content anytime? This would save so much time for beginners and pros. who do not check daily the community-board.
  9. Hi Allan The Movie shows the benefit or your Idea, with a Named Path. User are able to use the path from a existing geometry. And just attach the marionette object to it. A great "real-live" example.
  10. Nice, usefull example. But why you not just refer to the path directly?
  11. This Example shows, how to put labels with record infos and bounding box dimension on objects in the drawing. Could be usefull to make visible record values. Or auto-dimension objects. Just an idea-study not a matured example.
  12. Great Marissa/Robert, thanks for update A (real-live) Example for this attached: 1. A Truss (Just "stupid" crop a Truss Geometry by a length) 2. Write the lenghts into a record field attached to the marionette object 3. Creating a list of all "custom-lenght" trusses. Great product ! Edit: For those who care about the truss: It's just a "control"-geometry with a 2m truss. And I just cut away the rest. So the limit for the truss is 1.999m. You can expand the control-geometry-truss to 20m as example and have an 19.999m truss
  13. This is great Marissa. I made a little modification of your GetCell Node. The first Version was not able to return text values. I added a popup on the node to switch "number values" or "string values".
  14. Hi Imagine you have client, which delivers you a room list. And a list, which objects have to be in this rooms. You can consider this lists with hundreds of rooms on your left screen and click them one by one in your rooms. You will make errors and your eyes will get squared. Another real interesting example how you could accelerate a routine job with a marionette script. Look here: P.S Sometimes I remember the good old times I turned on the radio-volume and drawed hatches with single lines one by one.
  15. This Marionette Example, automatically place stake objects on every vertex point of all polys (parcel areas) on a specific class (input by any search criteria). Also the Marionette Script contains a custom node to filter double points. And a custom node to insert stake objects. This example has a potential for real application and also shows, how nice it is to control those stake pio's by a script. stake_objects.vwx
  16. DomC

    Scale Symbol

    Attached a Symbol Scale Node, which can do that. The Node has 4 knot Inputs for symbol, x, y, and z-scale. And another popup-input for scale type (None, Symmetric, Asymmetric) You could connect every object to this node. Just objects with type 15 (Symbol in Document) will be affected You can finde this Node on the "BIM Nodes" File posted in another topic. https://forum.vectorworks.net/index.php?/topic/47801-the-rest-of-domc-nodes/
  17. Hi For now the fastest way could be to keep your existing RandomSymbolNetwork alive and update the SymbolInFolder-Node with Version v02 . I extended the SymbolFoder Node as follows: A new Checkbox "IsFileFolder" If this Option is switched on, it takes all Symbols from a FileFolder in the Library/Defaults/MySymbolAreas/[Foldername.vwx] imports them and move them in a SymbolFolder (To not crash your ressource order ) with the same name. Maybe a future (easy) adaption could be, to always import the symbols in the same folder and delete the old symbols in the folder. So you can try out external content, without filling up your document ressources. reasonable? Cheers Dom
  18. Hi I think its just a problem of actualisation of the info-palette-view. The Objects change the class, but you do not see that immediately. To fix that, you could use "vs.ResetObject(h)" in the script Try this: c='Apt Construction' def DoIt(h): vs.SetClass(h, c) vs.ResetObject(h) return() criteria="(INSYMBOL & INOBJECT & INVIEWPORT & (SEL=TRUE))" vs.ForEachObject(DoIt, criteria) To unterstand the stript: 1. c='class', just set c to 'class'. Instead of that we could use also vs.SetClass(h, 'class') To use there a variable is better, because maybe later you want to input that class name in a dialog box etc. So it is better "ask" for the variable valuesat the beginning of a script. not really, if you want to work whith an activated object. Your idea goes in a direction to put all objects in "None" to another class. (Which also could be realized) the function ( which starts with "def"), containes a callback function for ForEachObject (FEO). And FEO takes a handle to the object and input it in the function as "h". Your Class Name you do not have to input by "FEO", because you defined it at start with c='Apt Construction' FEO loops all objects by a criteria and "def" says, what to do with them. Above I renamed the function to "DoIt". This makes it more clear, what happens. All clear? :-)
  19. A node, which triangulates and creates a mesh or 3d poly lists from a regular (and sorted) point grid. Features: 1. Solid mode "None" -> Creates a single area of triangulated areas 2. Solid mode "Floor" -> Creates a solid mesh with plain base. 3. Solid mode "Thickness" -> create an approximated (parallel) shell This node can draw a mesh and/or can return lists for further use.
  20. If it may be python: #python code c='class-1' def changeclass(h): vs.SetClass(h, c) return() vs.ForEachObjectInLayer(changeclass, 2, 1, 2) If you use this, check http://developer.vectorworks.net/index.php?title=VS:ForEachObjectInLayer for options Because "selectec object" could mean different things (all selected everywhere, just visible objects, etc.) You can use also: c='class-2' def changeclass(h): vs.SetClass(h, c) return() criteria="(INSYMBOL & INOBJECT & INVIEWPORT & (SEL=TRUE))" vs.ForEachObject(changeclass, criteria)
  21. Personally a big hope of me is, that the developpers have mercy and provide build-in functions to reshape. 1. How fantastic it was, we could handle a "Reshape"cube (3D) or a Polygon (2D) and at least modify objects the same way like the 2D Reshape tool (The engine seems to be there, we just need that in Marionette or script commands) 2. Even More fantastic if the tool (AND OR the function) could be setted up (An option level of how many times enter groups ) to go into containers (Extrudes etc) and modify as many geometry as possible. No constraints, no relations (no geniuses just a routine peace of work) would be necessary to realise such a powerfull and incomparable feature !!! OK, propably not as easy as that:-) .... but please
  22. New Version v093 available. Just some small changes and Bugfixes. Ebenfalls verfügbar eine "Schritt für Schritt" Anleitung auf Deutsch!
  23. #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()
  24. Thanks for feedback. 1. gridbox_divx Hi the Grid Wrapper is "old style". Attached a new Version, which uses the mix2Node with a cross reference. 2. Loft Surface If I test that, the points out of the "Get Z at XY" Node. Are exactly on NURBS Surfaces. Or NURBS Surfaces created with the loft tool. Propper measle-points :-) Maybe check first the points with a locus or sphere, instead of a Symbol. Maybe the 3D Symbol-node, produces something wrong. I did not checked that. Also Check this: 1. GetBBox should be used in 2D Plan View. 2. Set User Origin to Vectorworks origin 3. Draw near the Vectorworks origin 4. If you work with named objects check, if maybe the wrong object is named.
  25. Hi If I reverse the direction of the middle curve, and used the "order list" node, to be sure the curves processed the right order, the result is now the same as your "desired" object.
×
×
  • Create New...