Jump to content

DomC

Member
  • Posts

    543
  • Joined

  • Last visited

Everything posted by DomC

  1. If we play around with Record Formats and Lists. It can be useful to access external Lists of Data. I Attached a node, which bases on the python csv standard module. It can import lists as strings (text) or as numbers. It can't mix numbers and strings. Except Header (first Line) can be strings during the rest of the lists are numbers. It could be used for: 1. Import csv (or tab) separated text files by using an absolute path. 2. Import a csv with the same path and name of the Vectorworks file (for Metadata/Project data like Title Blocks etc.) 3. It puts out rows and lines separately. The used path and rows- and line quantity. v03: Popup with Text encoding List. Python Standard is 'utf-8'
  2. Check this out: A Quick-Modification of the "Get Record Field-Node", which returns a list of Field Names instead the Field Values. So you are able to automatically feed your Field Names. I hope this was not already part of the native nodes content. Dom
  3. Hallo Michael You can just input more than one object or more than one Field Names. This works good, if you know the field names respectively if you always have the same kind of record format. If you want to have the field names dynamically (another record with other field names) You need another construct (or node) which generates the field names automatically. Dom
  4. Hi Type ID's you will find in the appendix of the function reference: http://developer.vectorworks.net/index.php?title=VS:Function_Reference_Appendix At the moment a do not know what saved sheet means (German Version here) I think this are saved view? Then maybe check out this: https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=218533#Post218533 Dom
  5. Hi I just work on a script, that let us jump to the next saved view in alphabetical order. (I know Vectorworks Remote could do that) First Problem: Handle the saved views by script (I tried with ID, Parent etc. and failed). Thanks to Pat Standford (My Hero) which found a solution with vs.FIn3D :-) https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=118441 Second Problem: The saved views are stored in the order they was created. Here Python scripting is showing one advantage. We can beatifully sort list with python. #Python code to create list h=vs.FIn3D(vs.GetObject('Darstellungen'))# International Version "saved views" views=[] while h != None: name=vs.GetName(h) views.append(name) h=vs.NextObj(h) views.sort() # Sorts the list alphabetically An extended Version. It maintains a Text Block inside the document which acts as a counter in the document. Because after execution the script can't remember the last saved view. Maybe there is a more smarter way by using a hidden record or something like this. I am not familiar with that. #Python code to create list, grab and change the named(Info Palette Data field) text block and call up the saved view h=vs.FIn3D(vs.GetObject('Darstellungen'))# International Version "saved views" views=[] while h != None: name=vs.GetName(h) views.append(name) h=vs.NextObj(h) views.sort() # Sorts the list alphabetically zähler=vs.GetObject('zähler') #Handle to the text block Darstellung=vs.GetText(zähler) #Read Text index=views.index(Darstellung) #Check on which index of the list (of the sorted list) this view is stored if index < len(views)-1: # -1 it's because len counts from 0 I think vs.SetText(zähler, views[index+1]) #Change the Text block to the next saved view vs.Message(index) if index+1 == len(views): vs.SetText(zähler, views[0]) #Starts from the beginning vs.ResetObject(zähler) vs.VRestore(Darstellung) #call saved View This hits on an idea to make a slide show, from save views. With an automatically delay. But this is tricky, because it seems to be a feature from scripts, that they do not regenerate views during the script execution. I tried out with a Dialog Box. That seems to work. But who want's to klick a away a Dialoge Box after every Slide. I tried to do this this way: import time h=vs.FIn3D(vs.GetObject('Darstellungen')) views=[] i=0 while h != None: name=vs.GetName(h) views.append(name) h=vs.NextObj(h) views.sort() length=len(views) def view(): for i in range(length): #vs.Message(str(views[i])) #time.sleep(0.5) #vs.SetZoom(100) #vs.SetZoom(50) #vs.ReDrawAll vs.VRestore(views[i]) #vs.Wait(1) return() view()
  6. A new Version. We are able now to reshape control geometry directly (take 2D Plan view please ...) without any spam-messages :-) combined with the random box-fassade example.
  7. One step nearer to the solution ... anything goes with script, forget crampy worksheet formulas. #Formula in Worksheet: =RUNSCRIPT('script-1') #python script-1: A1=vs.CellValue(1,'A') pic=vs.GetObject('pic-1') if A1 >= 0: pic=vs.GetObject('pic-2') vs.WSScript_SetResImage(pic) "Just" have to find cell number, the script runs. To read out relative cells to the script cell.
  8. Hi Maybe not the right forum for worksheet formula questions. I am searching a way to insert an image in a worksheet cell by using a formula. I already searched the forum but could not find any related questions. What I am trying to do: If want to show an image in cell D1, if the cell A1 has the value greater than "0". =if((A1<>0), 'here i want an Image', 'false') I tried this: =IF((A1<>0), (IMAGE(N='k1')), '') #-> cell is empty =IF((A1<>0), D1, '') #D1 is refering to the cell "D1" which shows the image by =IMAGE(N='k1') =IF((A1<>0), IMAGE(N='k1'), '') #-> cell is empty also tried from other direction: =IMAGE((IF((A1<>0), "N='k1'", ''))) #-> error because of the double quote I think =IMAGE(E1) #Simple test, if IMAGE() formula can use values from other cells I give up... Any tips?
  9. Another one ... Fibonacci Sphere Point Node Somebody knows if we just can copy paste and utilize python code from the internet? I think yes. But it's courtesy to write the source of the script into the script code.
  10. Great Job Sarah, Your nodes are exactly this kind of stuff I like to see here. Thanks. Too bad I recognised but now :-)
  11. A new Version of this Object. I created the script new and under the object and module orientated marionette phylosophy. So it is based now on this nodes and wrappers: HandyNodesAndWrappers
  12. Some New nodes: (Also I notice, how much faster and better it is to first calculate the values just with list handling and at the end drawing real geometry. ) 2D Pt Shaker: Move every Point (2D Point list) randomly by a value looser: Deletes randomly values of a list shuffler: Randomly grab values out of the input and creates a new list with same length Symbol 2D and 3D All those nodes are handy to use with point grids to get a less strict look of a grid. A natural spread of points. If someone notice, that this stuff can be done with standard nodes, let me know this. It would be pointless to "hack" nodes for things that can be easy done with a wrapper or a standard node.
  13. There are some routine jobs to create point grids on 2D or 3D Objects for which I created some additional nodes and wrappers. I tried to make them proper and open like the standard nodes. I post a few of them. Core functionality: 1. Creating a Grid all over an Object's bounding box 2. Evaluating, if the created point are in or on a surface Different nodes for that, because it is better, to have not Nodes which do to much. So we can flexible use them in different cases.
  14. Thanks for sharing this Good Example to learn about creating lists and combining them in the right sequence for creating new objects. We can combine this truss wrapper with every NURBS curve we want. As example with NURBS created in the tutorial example. And it works. Up to some minor incompatibility between tutorial NURBS and NURBS which can be offsetted by this truss wrapper. Also some "closed" NURBS curves errors the list sequence of the truss node. But it shows impressively how easy we can combine "simple" nodes to more and more complex networks.
  15. Hi Tim I think this shoud be possible. But maybe not every function can be used simply inside the Vectorworks "container". Particularly functions which wants to open a dialog window, print something in the terminal Window and other user interaction. The instruction from Mark and FunkyBass for Numpy-Installation works fine here. I Installed it in a separate folder. And then copy/pasted it in the Vectorworks Application Content. I would not overplay with actions like this ...
  16. I enjoy you take an interest in that tool. Thank you! The Idea to use this on a 3d "area" seems to be very interesting. The node script based on the vs.PtInPoly(p, h) function which handels to the control geometry. If there is no poly it will end in a script error. For use it on a 3D Surface or a NURBs would be a complete different challenge. The symbol insertion part would be the same. But we would have to somehow build 3D Points on a NURBS Surface. Should be not impossible ...
  17. Hi there. A New Version of this Marionette Object is available. Fixed the "hardcoded" Foldername (Folder-1) of the first Upload :-) Now we can use any symbol folders we like.
  18. Thanks for hints Stacking order was the first I tried. But in this Object I have 10 Objects inside the group. So after every editing of the control geometry objects I have to check (send back the last object then the second last object until the first object is in background and the stacking ordner is right) So I searched for a less fragile workflow for me ... with record format. Can't see any technical problems with that. You are right, if everyone creates additional ressources for his objects, the mix of many objects will rubish up the document. But we should also remember, that a name has the same effect, like a ressource (even worse). I just personally have a bad feeling by naming objects. It is something like a bypass (which is easy to use) but can result often enough in conflicts with the other content of the project.
  19. Just a dalliance Maybe instructively in this example is, how to input the vertexes of a polygon split them and do something other with them. In this case I used it to move another object along the path. The standard move node was picked and the python sleep() function was integrated in it. So after every move it "sleeps" for a short flash and redraw the screen. Animation part could be more smarter with inch/seconds and another algorithm. I'm glad, we have AnimationWorks (http://www.ozcad.com.au/products/animationworks.php) for real animation projects.
  20. I searched quite a while for a way to handle different control geometries without naming them. Naming them is a possibility. But what's about copy, duplicate etc. those named object? They will loose their name, or get a new one. Also anytime, all those names will get in conflict maybe with other named objects. So my solution in this example is, to use a data base, for identifying the object. The other speciality is i have a Window PIO into the control geometry. So it can be used for frame etc. Known Issues: Elevation not implemented (routine task) IFC date etc. not checked (should be in the window)
  21. Instructive example. Thanks for sharing Robert. Another Question: For 3D wall cut, we can use 3D loci or the control geometry node (very nice, thanks for this) For 2D wall cut i use in my example 2D loci. 2D loci is OK for most wall objects. But an exact 2D cut would be desired. Is there another way to break 2D hole with a polygon. Maybe this? vs.AddSymToWall(wallHd, offDistance, heightDistance, flip, right, symbolName)
  22. DomC

    Complex suffix

    You should use vs.Num2Str() instead of Num2StrF() dim1 = vs.Num2Str(0, self.Params.dim1.value) dim2 = vs.Num2Str(0, self.Params.dim2.value)
  23. DomC

    Complex suffix

    Hi jc I can't find your object in die Drawing? With python you could just add strings like (variable1 + ' string'+ ' '+variable2) In marionette you can use the Math Node "add" A string variable in python (and marionette) is just a list of variable. That means: variable='hello' # h,e,l,l,o # and so variable[3] has a value from 'l' In marionette, you could use the data flow nodes to change lists (your string), split them etc.
  24. Hi all This idea is not matured. But maybe someone can be excited for it and help to finish it or push me to continue with this :-). Workflows are very country specific and scope specific. Lets say maybe at the End of BIM-Processes. Where details (rubber gasket etc.) have to be documented and parts has to be produced. I would want to follow up on this, because there is such a big potential for many building part supplier. Maybe a 3D reshape node, could also serve the design for a 3D Modell. How it works: (is planned) Just putting a Drawing in a Marinette Object. In the Marinette network there are resphape nodes wich are connected to reshape zones. Those Zones has to be integrated in the drawing. Every reshape node, produces a value in the Object info palette. What my example shows: 1. A Marionette Object with 3 "reshape" nodes. One Node reshapes all over the right side. The Other one reshapes with half of the value. 2. Also there are Lines in the Drawing which are connected to a worksheet. So values for piece should be calculated in that worksheet. This Example contains dwg import with suboptimal geometries and thousands of vertex points. No problem, it works is still without delay. Known Issues: - Reshape of dimension inside the object. Several object types not supported - No 3D, No PathObjects etc. Do not enter sub-containers etc. (don’t has to, i think) - Link to worksheet is not yet realized - filter list-input (more than one). Also automatic filter for itself and other reshape zones not realized yet - do not support polyline holes and polylines - Deleting zones not yet supported - more than one node creates handle problems for the zones Seems all solvable. But Support for all Objects could be unsolvable for me (it starts with dimensions)
×
×
  • Create New...