Jump to content

DomC

Member
  • Posts

    604
  • Joined

  • Last visited

Everything posted by DomC

  1. DomC

    reverse string

    You are so right, Dieter.
  2. DomC

    reverse string

    Hi Is there a reason, you want explicit make this in pascal-vectorscript or may it be in python-vectorscript? #Example: string='This text can be easy reversed by severel python functions' rev_string=string[::-1] vs.AlrtDialog(rev_string) #or even shorter rev_string='This text can be easy reversed by severel python functions'[::-1]
  3. Hi A much better, more flexibel version of the reshape node. The request for this kind of node, was not very big :-) But I still worked on this project. This node needs further explanations. I uploaded a movie for that node: Instructions: 1. Input a group in this node 2. This group contains a first group with drawing content 3. A second group with reshape groups in 4. A Reshape group contains a polygon and a parameter-dimension. 5.The reshape group has to be in front of the drawing group 6. The Input Nodes in the Marionette network inputs a parameter name and a value 7. The parameter name, has to be exactly (First two characters) the same, like the prefix of the parameter-dimension text. A suffix can be used, to set a operator (factor). In this way, there can be used a reshape zone which calculates his value out of another value without having its own input field (An object, which has to stay somewhere on a midpoint etc.) Vectorworks file with examples: (Re-) parametrisches Symbol v2016.vwx parametrisches Symbol v2017.vwx
  4. If anyone is interested. I got it :-) Object Value 13 and 14. Example Code (Activate a Dim, if you want to test or you will crash): dim=vs.FSActLayer() p1=(2,3,0) p2=(7,3,0) vs.SetObjectVariablePoint(dim,13,p1) vs.SetObjectVariablePoint(dim,14,p2) vs.ResetObject(dim) I found nothing in the VW appendix. I just looped all possible commands, settings and variables and searched the right kind of data.
  5. Yes, mixing real and dim values often results in errors in different files with different units. In the file it do not work, imperial (dark side) units are used :-) But in this case actually the 2D/3D separation part of the node can be blamed for this issue. And with "very good found" I mean, I also forgotten to check that in my custom node "PutByRefPt"
  6. Hi Nik I think you found a "limitation" in the move node. Newly created and duplicated objecs are aligned on the plane (Screen Plane, Layer Plane), which the document is setup to. But the move node try something to handle with planar, not planar, 3D Point, 2D Point,2D move and 3D Move. So because point input is a 3d-Point and your object is sreen-plane (2D), it do not move. Very good found ... :-)
  7. Another (universally usable and flexible) linear Array node. It does not handle the objects itself. It just calculates values, which can be used for creating, moving duplicate etc. objects by the values from this node.
  8. The Order is 1. Back, 2. Top, first connection, left. Or something like this. I don't know exactly. But: A Number as a suffix, will overdrive the order. I tried this, but not sure if this works stable.
  9. Sorry, to answer to that: This Pass Node there is just useless. An oddment ...
  10. I use pass nodes for: 1. Creating them as a kind of "dispenser" for not having wires all over the whole script. 2. For labeling the kind of data which are transported 3. for getting out of a wrapper by naming the pass node at get a knot on the wrapper. 4. Also, if I think there could be a wrapper later in the process I install pass nodes. Like electrical tins for future connections in a building. I do not want to break my electrical wires in the house to connect additional plugs. So i Install tins for later use. 5. Object Order checking. I for myself do not check the ordner. I Just reorder them if anything changed :-) I Just put them in front in the order, I want them to have (Like the curves in a site modell ) Put first object in front, then second, then third ..... etc. After all that the first object will be the very back :-) Thats the only way I know to be sure, the order is correct (If you have 3d Obj, maybe the order can't be seen) without putting them all above the other. If there ar at one point, right mouse button and checking overlapping objects (Don't know the function in the international Version) Always the object get collected by the order. But there are many ideas to sort the objects in a way the ordner doesn't matter.
  11. Hi Alan The first content-node returns two objects (two groups). The first group inputted again in a content-node and then returns the 4 profiles. The second group is used directly (keeping grouped) for the brochures. Further explanations: 1. The control-geometry-node exactly collects just one (first back) object in the control-geometry container. So if there are more than one objects they have to be grouped. 2. I created two more groups inside the first group (which can be entered with "content" node). First (back) for Profiles. Second (front) for brochures. The Input in Marionette goes from back to front (order of the objects). 3. Because I have groups I use "content-nodes" to go deeper inside the groups. Also groups helping to order (an object in the first group will never goes in ordner of a object from the second group). So groups help here to structure the input geometry order. 4. The sort lists also helps to get control of the object order. They are not essentially but without order list, the sequence of node wires would be relevant for the object order and this results in even more fragility of the input system. 5. At least by editing control-geometry we have to take care about not changing the object and group orders. Group will not change order because we just have to enter them. But if there several objects inside a group, the ordner of this objects easily will change, if we redraw/delete them. To solve that order Issue every single object should be grouped (Which I did not made in this example) Or an other strategy to handle the objects (Names are not possible, because of duplication or copy/paste in new documents they got lost). Alternatives were symbols (Which is the best option I think) or record formats to handle objects. Also the network contains some "delete"-nodes. Which I think maybe have no effect. Sometimes controll geometry was obstinately visible. I just tried to get them away :-) Sorry for my english. Hope it can be unterstood. Dom
  12. Support 2D/3D objects and points. Returns min max positions and values. Can be used for putting geometry together or grabbing objects and move them to a specific point. Also this could be done with native nodes, by getting 3D infos and calculating offset to specific points and moving them by the offset. I am not sure, what is the right strategy to do those things in future (wrapper vs. node).
  13. Hi This file is running properly on my mac (Wrap). I Suppose there could be a Problem with the File Name, File Path, Vectorworks Installation Path or the User Settings (User/Library/Application Support/Vectorworks /2016 /PlugIns) try out deleting the marionette folder here. Hope that works ... Mac OSX 10.10.5 i7
  14. Hi This Marionette PIO draws a brochure holder with various settings. Parameters over Info Palette. Profiles and brochure (Brochure Textures, brochure Format) over control geometry. Enter and edit control geometry in top plan view (correct bounding box). Special: Use of a custom Node, which automatically alines an object by it's bounding box to a refered place.
  15. Hi What to do, if Input Values from "non-Dim-Nodes" deliver wrong dimension values? It could be horrible just to multiply lists/tuples, point values etc. by factor. Attached Node can help. It calculates every value of list up to double nested lists by the unit factor of the document. This node just works but the code inside could look ugly to a programmer. But as yet I did not found anything better than that. How it works: The Node has a Popup. With that popup you can set the input units. And get output values in the document units. Dom
  16. Wow ... nice Rendering. This cry out for a random-book-arrow-marionette-pio :-) Dom
  17. New version v0.9: Also available a mutation with a "value-feeder" to create a complete furniture wall. The Info-Palette is a bit cryptic but allows. Thousands of Variants, with just about 20 input Fields.
  18. Hi Attached, an Example. Dom 1. Script in the cell: =RUNSCRIPT('kantenbild-script') 2. Script which will be executed: sheet_h=vs.ActSSheet() if sheet_h != None and vs.GetName(sheet_h)!='XGST-VSSM Liste mit KB': numRows, numColumns=vs.GetWSRowColumnCount(sheet_h) startrow=9 rows=numRows-startrow for x in range(rows): kabi=[] k=[] k1=vs.GetWSCellString(sheet_h,x+startrow, 14) k2=vs.GetWSCellString(sheet_h,x+startrow, 16) k3=vs.GetWSCellString(sheet_h,x+startrow, 18) k4=vs.GetWSCellString(sheet_h,x+startrow, 20) k=([k1],[k2],[k3],[k4]) for i in range(4): if k[i] !=['']: kabi.append('1') if k[i] ==['']: kabi.append('0') vs.SetWSCellVertAlignment(sheet_h, startrow, 24, numRows, 24, 3) vs.SetWSColumnWidth(sheet_h, 24, 24, 37) vs.SetWSImgSizeType(sheet_h, x+startrow, 24, x+startrow,24, 1) vs.SetWSImgSize(sheet_h, x+startrow, 24, x+startrow, 24, 48, 48) vs.SetWSRowHeight(sheet_h, startrow, numRows, 37, True, True) vs.SetWSCellFormula(sheet_h, x+startrow, 24, x+startrow, 24, '=IMAGE(N=\'n.vssm.k'+str(kabi[0])+str(kabi[1])+str(kabi[2])+str(kabi[3])+'\')')
  19. A Text-Script based Marionette Object. Technical Info: About 30 Options in the Infopalette. And many if then combinations, which results in drawing/not drawing a part of the cabinet. I did this first with a graphical script network. But there was no possibility to NOT execute part of a graphical script because of an option. It is just possible to execute/draw everything and then delete objects. Which results in a disadvantage of speed. So I desided to write code instead. Anyway, this is also something, marionette can be used for. Dom Edit: 24.12.2015 new Version (Dim Values, Shells)
  20. Hm .. python should accept mix of single AND double quotes to use quote inside a string. So your example should work. Also maybe checked out by escape quote by \ ? vs.Message('I\'ve made it this far') It seems to work inside the Vectorscript Editor. Maybe if you have this in an external text file, Text encoding, text reading routines etc. do their part to destort the string. TextEdit saves (as standard) with UTF-8. Vectorworks imports with ...? Just an unqualified idea
  21. Hi If you are working on Windows, maybe your anti-virus-software (AVAST maybe), will block your Vectorworks from launching. Try pause your anti virus for 5 Minutes and launch Vectorworks. If that works, add The Vectorworks Programm Folder to the "Whitelist" and activate virus protection again. Also check, if your graphic driver is fairly up to date: http://kbase.vectorworks.net/questions/1139/Video+Card+%7B47%7D+Graphics+Card+Guidelines+for+Vectorworks+-+Oct+20%2C+2015 On mac, it could be a font-issue. It's a shot in the dark but accidentally i saw exactly the same"overnight" problem with avast anti virus last week. If it was an avast-issue, a short feedback would be nice. Dom
  22. Tim Thanks a lot. Your post brought me to search in the right direction There seems to be many solutions to convert with python. But after several encoding, decoding tries. I searched again "http://developer.vectorworks.net/" for encoding topics. Lo and behold: There was a vectorscript function to do that job :-)!!! vs.StringAnsiToMac(string) Nice. Thanks again Tim Dom
  23. Hi there I wonder how to handle special character issues in a smooth way. I use the following commands in my script: HSFPath=vs.GetFPathName() bool, path=vs.ConvertHSF2PosixPath(HSFPath) My File name is äöüéè.vwx. And Vectorscript procudes a file path like "C:\Users\dom\Desktop\‰ˆ¸ÈË.vwx" After that I have to replace those "characters" manually by script: umlaut={'ä':'‰','ö':'ˆ','ü':'¸','é':'È','è':'Ë','à':'à'} #Python dict with the replace character path=path.replace(umlaut.get('ä'),'ä') #umlaut.get(dictkey) path=path.replace(umlaut.get('ö'),'ö') path=path.replace(umlaut.get('ü'),'ü') path=path.replace(umlaut.get('é'),'é') path=path.replace(umlaut.get('è'),'è') path=path.replace(umlaut.get('à'),'à') OK, the path.replace part, maybe could maybe be better programmed. But is there any standard procedure for file-path-character issues like this? Handling pathes is daily business. Well, it works on mac platform. The complete script: HSFPath=vs.GetFPathName() bool, path=vs.ConvertHSF2PosixPath(HSFPath) umlaut={'ä':'‰','ö':'ˆ','ü':'¸','é':'È','è':'Ë','à':'à'} path=path.replace(umlaut.get('ä'),'ä') path=path.replace(umlaut.get('ö'),'ö') path=path.replace(umlaut.get('ü'),'ü') path=path.replace(umlaut.get('é'),'é') path=path.replace(umlaut.get('è'),'è') path=path.replace(umlaut.get('à'),'à') path=path[:-3]+'txt' inPath=path skipHeader= False asString=True delimiter="\t" codex='iso8859_2' #'latin_1', 'iso8859_2', 'mac_latin2','utf_8' #https://docs.python.org/3/library/codecs.html lines=[] rows=[] import csv import os if asString==False: quote=csv.QUOTE_NONNUMERIC else: quote=csv.QUOTE_NONE if os.path.isfile(inPath) == False: vs.AlrtDialog('Das Info-File der ERP Software wurde nicht gefunden. Dieses Script liesst eine Textdatei mit gleichem Namen wie die Vectorworks Datei ein. Bitte Erkundigen Sie sich bei Ihrem ERP/PPS Softwarelieferanten über diese Möglichkeit') rowNum=10 lineNum=10 if os.path.isfile(inPath) ==False: for x in range(rowNum): rows.append('error Import File') for x in range(lineNum): lines.append('error') FilePath=('import File missed') if os.path.isfile(inPath) ==True: with open(inPath, encoding=codex) as f: reader= csv.reader(f,dialect='excel',delimiter=delimiter,quoting=quote) if skipHeader==True: next(reader) for line in reader: lines.append(line) lineNum=len(lines) rowNum=len(line) for row in range(rowNum): rown=[] for line in range(lineNum): rown.append(lines[line][row]) rows.append(rown) if asString==False: rows = tuple(tuple(x) for x in rows) rows = list(rows) lines = tuple(tuple(x) for x in lines) lines = list(lines) erpdict=dict(zip(lines[0], lines[1])) plankopf="INSYMBOL & INOBJECT & INVIEWPORT & ('VAA Title Block'.'__Other4'='ERP_Plankopf')" #plankopf="INGROUP & INVIEWPORT & (R IN ['VAA Title Block'])" def PlankopfFelder(h): vs.SetRField(h, 'VAA Title Block', '__ProjName', erpdict.get('PRO_STAMM_PROJEKTBEZ')) vs.SetRField(h, 'VAA Title Block', '__ClientName', erpdict.get('ADR_NAME_FIRMA')) vs.SetRField(h, 'VAA Title Block', '__ProjAddress', erpdict.get('ADR_STRASSE')+', '+erpdict.get('ADR_PLZ')+' '+erpdict.get('ADR_ORT')) vs.SetRField(h, 'VAA Title Block', '__ProjNo', erpdict.get('PRO_STAMM_PROJEKTNR')) vs.ResetObject(h) return() vs.ForEachObject(PlankopfFelder, plankopf)
  24. How About directly input the symbol in your extrude? You could edit your symbol properties (blue symbol) and insert the symbol directly as a poly (as long as you have not more than one object in the symbol) Any-Input-Node, can be handy for testing (even better than connecting many of input nodes to simulate an input :-). At a more final version, we should use dim-inputs for input values (Document Units).
×
×
  • Create New...