Jump to content

DomC

Member
  • Posts

    605
  • Joined

  • Last visited

Everything posted by DomC

  1. Negative ... I use Vectorworks 2018 SP1 German Version. Mac OSX 10.12.6. Same issue with the above url.
  2. Hi Thanks for Input. I can install PIL from external python package. Even I can copy/paste PIL 3.0.0 from my 2017 user Folder and it works. I think embedded python version in 2018 is 3.5 .. So far it makes no sense to use external moduls in Marionette nodes if users have to install them manually. The task is to check and install the module inside the node with the embedded python. I am sure, there are ways to do the installation with a subprocess or by changing something in the Function or by updating something inside the embedded python. An installer routine for external python modules in Marionette nodes is something, which already exists. I tried with some options like '--verbose' (detailed error log) etc. from the PIP Documentation here: https://pip.pypa.io/en/stable/reference/pip/ Could be everything. From a user Error (wrong package, wrong url) over a Bug in PIL, an Installer Bug to a Vectorworks incompatibility ... I played around with the Marionette Module checker (With this code as a simple Script it do not crash and I was able to play around with some parameters) I think I should stop investing my time for that issue. The Error log: The most interesting code line: ret_code = pip.main(['install', appuserfldr + downloadedfile, '--target', cmd ]) The Module Installer: import vs from collections import OrderedDict import operator import copy import os, sys, subprocess, urllib.request, importlib, logging exit_code = False appfolder = vs.GetFolderPath(1) appuserfldr = vs.GetFolderPath(12) cmd = 'Python Externals' missngLibURL = 'https://pypi.python.org/packages/c0/53/744c1127f0fa988c742f9db6615127125f993da8324e3126b3d769947fc0/Pillow-4.0.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl' #missngLibURL = 'https://pypi.python.org/packages/8b/aa/e62f29194562a58f1e1e4158899bb0e33052db824c08e0eb7ea806315b61/Pillow-3.0.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl' missingLib = 'PIL' #https://pip.pypa.io/en/stable/reference/pip/#general-options if sys.platform == 'win32': cmd = appuserfldr + cmd elif sys.platform == 'darwin': pos = appfolder.find(':') appfolder = appfolder[pos:] appfolder = appfolder.replace(':','/') pos = appuserfldr.find(':') appuserfldr = appuserfldr[pos:] appuserfldr = appuserfldr.replace(':','/') cmd = appuserfldr + cmd if not os.path.exists(cmd): os.makedirs(cmd) sys.path.append(cmd) try: try: importlib.import_module(missingLib) exit_code = True except ImportError: #show dialog here question = 'Python module ' + missingLib + ' is not installed. Would you like to download and install it now?' res = vs. AlertQuestion(question,'', 1,'','','','') if res == 1 : if sys.platform == 'win32': piploc = 'Python33\Scripts\pip.exe' pathpip = 'Python33\Scripts' cdpath = os.path.join(appfolder, pathpip) cmdpip = os.path.join(appfolder, piploc) wd = os.getcwd() if os.path.exists(cmd) and os.path.exists(cmdpip): os.chdir(cdpath) ret_code = subprocess.call([cmdpip, 'install', missngLibURL, '-t', cmd ]) if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be downloaded.'); exit_code = False else: exit_code = True sys.path.append(cmd) os.chdir(wd) elif sys.platform == 'darwin': import pip import urllib.request pos1 = missngLibURL.rfind('/') pos2 = missngLibURL.rfind('whl') downloadedfile = missngLibURL[pos1+1:pos2] downloadedfile = downloadedfile+'whl' urllib.request.urlretrieve(missngLibURL, appuserfldr + downloadedfile) #vs.Message(str(downloadedfile)) ret_code = pip.main(['install', appuserfldr + downloadedfile, '--target', cmd ]) # original Line ret_code = pip.main(['install', appuserfldr + downloadedfile, '-q', '--target', cmd ]) if ret_code > 0: vs.AlrtDialog('Module ', missingLib, ' cannot be downloaded.'); exit_code = False else: exit_code = True sys.path.append(cmd) else: exit_code = False except: pass
  3. Hi Anyone got the PIL Auto-Library-Installer got to work with 2018? I am testing with this Python-Vectorscript on Mac Sierra: #Python Script import Marionette PillowPath = 'https://pypi.python.org/packages/c0/53/744c1127f0fa988c742f9db6615127125f993da8324e3126b3d769947fc0/Pillow-4.0.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl' Marionette.VerifyOrGetLib('PIL', PillowPath) I think maybe this installer package is not for sierra ... A strange thing happens, if I run the script (Or run it in a Marionette Node, it's the same): My Vectorworks starts a 2nd time while the original Vectorworks freezes All other other tested Packages works fine: ShapelyPath = 'https://pypi.python.org/packages/83/38/67f9826a0e6ac8e3dbf9207b1e30f6e74f042e8a4ff0a958fb113ef81d12/Shapely-1.6.2.post1-cp35-cp35m-macosx_10_9_intel.macosx_10_9_x86_64.whl#md5=ab1afb53f6ba7f0b26f24e2c8485dced' matplotlibPath = 'https://pypi.python.org/packages/ca/3a/ed9fdea2d54d5d547ef24d98da5ad4354754e10cbc2e4159a29cb44d0b8a/matplotlib-2.1.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl' Also Scipy, Numpy Why of all things "Pillow" :-( Is there any alternative?
  4. Hi You can insert a PIO with "Marionette Default Library" -> "BIM" -> "Symbols" -> "Create Custom Object / Path" . And then change values like declared by sarah. Maybe some PIOs need further objects like path etc. If you create a Camera Object it can look strange because with the tool you draw a line, which defines some values. You can set this values with Set Record Field Node. Do it as follows: Draw a Camera with the tool ... create a Worksheet and play with the values and look, how to name the field names. The attached example is the same as from sarah, with additionally the "Create Custom Object" Node. The Camera looks strange, because the line length will be 0. Use Field name 'LineLength' to set the Line Length. Camera.vwx
  5. To make transparent, what we are talking about. I created a script, which takes practically no time to regenerate. Because it just contains 515 pass nodes. Method 1, conventional (every PIO has it's own script): 1. Wrapping Network (attach python code) ---> 21s 2. Convert to Object Node (Reset on Move) ---> 1.5s 3. Move (Reset) ---> 1.5s 4. Duplicate (re-attach Python code) --> 22s 5. copy/paste ---> 22s 6. copy/paste to new document ---> 2s 7. copy/paste to new 2nd time ---> 2s Method 2, PIO contains a Symbol with the script inside The Python code will be attached just once on that symbol 1. Create (black) Symbol of Network 27s 2. Insert Symbol in PIO and exit 42s 3. Move (Reset) ---> 1.5s 4. Duplicate --> 22s 5. copy/paste ---> 7s 5. copy/paste to new document ---> 7s 5. copy/paste to new 2nd time ---> 2s What we can learn from this? I am not sure. I would say, it's normal that Marionette takes some time to "cache" a script from the connected node network. What maybe have some potential for optimization is the way the script is updated (every PIO has unique informations/script) if the object gets duplicated. Also we can see , that the method 2 (symbol for script instance to sync PIOs) is not faster -rather slower. Anyway, this method seems to work not as good as in v2017 (reset-issue) Hmm ... Test_Marionette.vwx
  6. Hi I saw scripts with about 1500 Nodes without any issues. The time to edit/exit or duplicate scripts is higher if there are many nodes. But this hast no direct relation to the speed of the compiled script itself. The attached example takes a long time to run, because it writes values in a record attached to all Marionette PIOs which can result in regeneration of all PIOs (I don't know right now). In a short sentence: This example is not representative for speed of Marionette PIOs.
  7. Maybe someone knows, how to trigger the same mechanism like "edit script" and "exit script" ? There are always some new issues if there was changes since the last Version. I hope there will soon be any time investments in that from VW Inc. The loss of Values after duplication seems to be a blocker at the moment. Also converting files from 2017 Marionette-PIOs results in PIOs, which will be reset after changing some values without edit and exit the script. To edit and exit the script can be a workaround. I am fighting with the same problem here at the moment, but it is unfortunately a little more complicated, there are hundreds of Marionette PIOs in many Documents and the script is not open in the pio, it is wrapped in a symbol instance which worked in 2017 (to sync all PIOs with the same script). The Workaround by edit PIO Script and exit will not work because it reset all PIOs. The PIO itself regenerates the other PIOs. So touching the PIOs in a conventional way will not work. The other alternative (maybe the most economic) was to convert pios to groups and work without marionette or stay on 2017. Apparently there is no fix for this in the next few weeks (month) so I tried to fix that by a python script --> with moderate success. At least it brings the document to a version in which I can edit every pio and exit to fix the values. Maybe It can help someone with the same task The Script just fix my specific issue (two most important values will be replaced not all). Somehow the Names of the fields can change by reset in 2018. So this can't be use to generally fix all PIOs or Values. Attached VW Document contains a choice of parts. #Dom C 2017-11-3- Be carefull using this scrip and work on a backup of your original documents. No warranty. import json criteria = "((PON='MarionetteObject2D'))" #collecting every Marionette PIO in the drawing pios = [] def collect_data(h): pios.append(h) vs.ForEachObject(collect_data, criteria) #read the Info-palette of a Marionette PIO. The data is stored as a json dictionary #I just have to read the Field LaengeX and BreiteY. The others can reset to default def get_values(o): data = vs.GetRField(o,'MarionetteObject2D','NodeDef_OIPControls') d = json.loads(data) LaengeX = BreiteY = 0 for field in d['data']: for subfield in field: v = field[subfield] if "LaengeX" in str(v): LaengeX = field['value'] if "BreiteY" in str(v): BreiteY = field['value'] return (LaengeX, BreiteY) # Modify and write the PIO Info-Palette def set_values(o,original_Values): data = vs.GetRField(o,'MarionetteObject2D','NodeDef_OIPControls') d = json.loads(data) LaengeX, BreiteY = original_Values for field in d['data']: for subfield in field: v = field[subfield] if "LaengeX" in str(v): #"LaengeX" can be "3LaengeX" etc. So don't use "equal here" field['value'] = LaengeX if "BreiteY" in str(v): field['value'] = BreiteY data = vs.SetRField(o,'MarionetteObject2D','NodeDef_OIPControls', json.dumps(d)) original_Values = [] for obj in pios: #read data of every pio original_Values.append(get_values(obj)) for i in range(len(pios)): #eliminate the symbol inside the PIO and make it a "normal" marionette script o = vs.GetCustomObjectProfileGroup(pios[i]) h = vs.FInGroup(o) vs.SymbolToGroup(h, 0) h = vs.FInGroup(o) vs.HUngroup(h) #vs.DoMenuTextByName('Reset All Plug-Ins',0) --> Not a good idea #write the data again on the pio objects. Without this the data would be lost after #converting the script-symbol into a normal script for i in range(len(pios)): set_values(pios[i],original_Values[i]) #vs.DoMenuTextByName('Edit Group',0) #now double click every Marionette pio, this will fix the existing pios. PIO_Reset_Issue.vwx
  8. Version 1.0.1

    251 downloads

    https://youtu.be/vuCvK4OwN80 German Movie https://youtu.be/Nm0te1zmpVY English Movie Structure of the Input: 1. Group with Geometry group (send to back) and Reshape Zone definition (send to front). Best practice is to use a blue smbol without screen plane objects 2. Reshape Zone group has further groups. Every reshape zones (polygons) is grouped with a dimension object. The dimension is the link to the script. The parameter name is a prefix of the dimension text 3. Use one of the existing examples to understand the system Limitations: 1. Supportes not 3D, Chain Dimension, path objects, rectangles. Container objects are not reshaped but moved (like the reshape tool) 2. user origin has to be set to vectorworks origin 3. not mix of screen-plane and layer plane. Use all layer-plane 4. ...
  9. Agree ... In 2018 the Message Window shows much more characters. As much, the Window size allows (look screenshot). I think that's a great improvement. Amd cause we use python we have so much more possibilities. One good Idea is the logfile. And this logfile could be opened at the end of the script to have a good comfort. import subprocess subprocess.call(['open', '-a', 'TextEdit', thepathtologfile]) That will open an application (TextEdit as example) after the script. That's very comfortable. Also It allows to copy/paste Values, which seems not possible by vs.Message()
  10. I also used such a node in several networks (I called "Values to Saldo" ). Seems to be something often used. Maybe a candidate for standard node content? So we would use all the same node with the same code and the same content ... :-)
  11. Hi This is a little Trailer Movie Clip of some Marionette Scripts I saw the last month. Maybe it can inspire you to keep up or attempt your Marionette projects. Some of the shown examples are used in real-fields and or not shared public. But the technology is used from shared Marionette products here in the forum. Please keep on doing this, every post, every idea and question is valuable. Special thanks to the University of Applied Science Ostwestfalen-Lippe https://www.hs-owl.de/ Graf | Hagen | Völz and their students shared some insights and pictures of their wonderful projects. I used some pictures at 1:09-1:30 of the Movie. Little-Trailer.mp4
  12. Maybe I am sick on Monday :-)) Edit: Seems to be related to Preferences.
  13. I have it at the moment (Got to work on a presentation and that really stops me now ) I am working with marionette nodes. Now I have the following symptom: 1. Objekt-Info of every PIO in every File do not work correctly anymore 2. After restarting Vectorworks it works again for a while 3. I have it reproducible if I create a menu command of a Wrapper. 4. After that, the Info-Palette is completely numb I have to restart Vectorworks -on a Mac :-) Maybe it's because I work in a Beta-Build of German Version based on SP1 ... I reported this as a bug with a vwx and a movie file ...
  14. DomC

    New Nodes 2018

    To be exact: It is technical impossible to snap the most bottom port if a corner of a node is inside the snap-radius and Master-Snaps are on.
  15. DomC

    New Nodes 2018

    Hi I tried to make the effort to find the new node from 2018 release. Any additions? "Valve" seems the most important and a real milestone for me, because it integrates a real new method to block networks.
  16. Hi Don't know if I completely unterstand the question because I can't really follow your request. You don't need to store a value in the Params class, if you don't want to use it for data-flow. If you just need the variable inside the node, you could create the variable in the RunNode() method. "self.Params.variable_name.value" you just need to get variables out of the Params class. Params class is for input ports and input fields. If you don't need ports and fields, don't use the Params class. Just write Fx_Value = 500; Waarde_Slag_Of_Groef = 400; Corpus_Breedte = 600 and so on in top of your RundNode()'s code. Example create value in RunNode(): @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( 'aNode' ) def RunNode(self): Fx_Value = 500 vs.Message(str(Fx_Value)) #or this ? Waarde_Slag_Of_Groef = 20 Corpus_Breedte = 600 Dikte_Zijde_L = 19 Dikte_Zijde_R = 19 Waarde_Slag_Of_Groef = 2 breedte_Rug = Waarde_Slag_Of_Groef + Corpus_Breedte - Dikte_Zijde_L - Dikte_Zijde_R + Waarde_Slag_Of_Groef #or in one line Waarde_Slag_Of_Groef = 20; Corpus_Breedte = 600; Dikte_Zijde_L = 19; Dikte_Zijde_R = 19; Waarde_Slag_Of_Groef = 2 Or if you exactly want to store your value in Params class, without having any input field or knots, you could maybe make something like this. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( 'aNode' ) Marionette.variable_name = 500 def RunNode(self): Fx_Value = Marionette.variable_name vs.Message(str(Fx_Value)) This code maybe is dangerous, because If you use the same "variable_name" in another node this could overwrite your variable_name. Don't know if this could be an issue, probably not.
  17. @Stephan Moenninghoff Äh, yeah. In previous Versions numbers over 9 did not work. So we avoid by numbering with 1_1 1_2 3_3 or 7, 8, 9, A, B, C etc. Now for me it seems we can just take a Number to sort. It will be not so clever to sort like 1,2,3,4 ... 12,13,14,15. So I just sorted with 100 200 300 400 500 600 The Main-Positions or the seperators. And Sup-Positions with 110 120 130 140. And there is always enought space to push some new inputs between the existing inputs. Looks perfectly for my now.
  18. Hi 0_1, 0_2 ... seems not to work not the same in 2018. The Number after the unterscore is now part of the name. I made some test and best input-sorting-workflow for me seems to work with a three-digit number. Also seems to be an efficient workflow to use a worksheet for node (re)-naming.
  19. Hi Do you mean the size of a Wrapper or the size of the network inside your wrapper? Can't confirm this with VW 2017, a wrapper's width (the wrapper-node width) is always about 10% of a DIN A4 width independent of the document unit Marionette Objects are page based. Maybe your layer scale is not the same and you run into this one: https://forum.vectorworks.net/index.php?/topic/51667-marionette-node-scale/ You could first change the layer scale like your target layer scale and then copy/paste. Or scale the content of your wrapper with the scale difference. If your created objects are too small, check your input values, maybe they changed by copy/paste to default or you are not using dim input nodes for size-values (In this case it should be bigger not smaller with cm).
  20. Hi Welcome by the mountaineers. I will not post the corrected network because doing ourselves gives stamina. Debug your script from left to right and disconnect the rest of the nodes, instead a pass or a dummy node and click on the wire with the beetle(bug) method: 1. The name of the rectangle which defines your bounding box of the geometry is "x" nothing wrong with that, but I think a standard user-error by clicking "x" for the selection tool in a field :-) If you need that rectangle here just for the bounding box, you don't have to make a copy here. 2. Object Name in the input field is "rec" You should take "x" for the name input field. "x" is the name of your rectangle. 3. The Range Node is designed to make a range from a lower value (input a) to a higher value (input b). Replace start and stop of the bottom range node 4. You go two range for x and y coordinates now. The Mix Node has a popup in the info-palette. Select "Cross Reference". Cross Reference, will repeat the sequence from the "list 2" input. By the length (number of values) of the list1 input. Simultaneous every values from lis1 is repeated by the length of list2 input. So you got a perfect point grid with 6x6 points. 5. The input for circle radius is by an integer input. Please use the Dim Input. Also switch document units to mm cm or m (https://en.wikipedia.org/wiki/International_System_of_Units) Sorry forthat, but imperial units blocks my brain :-) 6. So with those reasonable units you will see, that your radius is bigger than your rectangle and you want to have 36 circles on that rectangle, that can't work. 7. The Solid Operation is set to "add" instead of substract (I think so because your bottom and top are the same) 8. Then you substract the rectangle extrude from the circle extrudes, that would made the whole thing needless. Or could create antimatter (subscract a big mass from a lower mass). Always a hard start. Comfort you my first network was not better. I maybe would practice with simple locus points first to see, what is going on without accidentally booling billions of solid operations and freeze your computer. In this case I think it was not the reason mat that does not matter after fixing the (little but a good many :-) errors it will work. Don't give up. Dom
  21. Confirmed, I had the same Issue here. Which Build do you use? At the moment I can't reproduce. I used 387649 and I had this issue after every change of Marionette PIO Option in the Palette. After Rescale Info-Palette it was OK until the next object active and changing something, I ignored it and got to bed... iMac 27" Sierra at Home. Now I tried again with Build 390873 Mac Sierra in the office it looks fine now :-)
  22. DomC

    Updating Node

    Hi Marissa Thanks for quick reply! That's OK. In a special case I used a Beta-Node(Which frequently has to be updated) 100 times in a Drawing (to test different usecases and objects) and used the "Preprocessor" to speed up that process. Maybe for making this, it was a better choice to directly import the code as an external module directly into the node execution next time. Besides, my fairly efficient workflow to edit nodes in the Drawing. It pops up a Script-Edit-Dialoge for every node which matchs to the criteria vs.DSelectAll() criteria = "(('MarionetteNode'.'NodeLocalizedType'='The Node Name'))" def DoIt(h): vs.SetSelect(h) vs.EditObjectSpecial(h, 4)#The edit mode: 0-Default; 2-Properties; 3-Reshape; 4-Edit group like; vs.SetDSelect(h) vs.ForEachObject(DoIt,criteria)
  23. DomC

    Updating Node

    Um Have to correct this. Seems like updating the nodes to 2018 deletes (Even if I copy the python Scripts in the library folder) the first line with the #COMMAND;REFFILE; ...... link ... a case for a Bug Report? Either way, Great Version! Particular Multi-View is incredible cool for Marionette Scripters
×
×
  • Create New...