• Content count

  • Joined

  • Last visited

Community Reputation

92 Excellent

About DomC

  • Rank

Personal Information

  • Location
  1. Version 1.0.0


    This Nodes breaks up and scale a 3D Solid Geometry and the result is similar like a 2D Geometry reshaped by the 2D Reshape Tool. The Input Geometry (Geometries) have to be grouped. You can input it from symbol or control geometry. The Node is designed with some love to detail and make the job in many situation just right. It follows some rules: 1. reference Point is left bottom back 2. Overlapping geometries over the zero point to left, back or bottom are handled symmetric. You can use locus points to direct the correct symmetry. 3. The nodes cut a geometry in 3 parts. the end parts are called "caps". The Node allows to scale the caps or the middle part (in most cases the right mode) 4. It is necessary the input geometry is a group. 5. Grouped Objects completely inside caps, will be moved as well 6. Objects between the caps, will be moved half value This advantage of this node, is to allow an incredible fast production of a specific type of PlugIn Objects (Reshape in x, y, z direction Middle Part is scaled like Tables, Pillars, Handles etc.) Movies: Simple Example (Pillar): More Complex Example(Window Element): Further Examples:
  2. The post is about storing preferences into a node by clicking the button. All Parameter we can use in a Marionette PIO are available in the Info-Palette. If we could use a (complex) Dialog with several detail parameter for the object, this would help to keep a powerfull object easy to use. The Issue with that is, that the button (The Dialog) do not work anymore inside a PIO. It just works in a wrapper or as a node. The other wish (predifined parameters, complexe setting dialoge) could be solved somehow. If you just need a button-use example. I attached a button, which shows an simple alert dialog Button Example.vwx
  3. Another great Example, that shows, how potent the Integration of Marionette Objects is, to customize (Nothing other that will be the logical result of Industry 4.0) core features. I would like to see that Feature for windows and other core plugins! Sure, VW Inc. had to optimize some details to get a good enough marionette-quality (duplication of PIOs takes too much time) for integration capability in core PIOs
  4. Really great, that works.
  5. Hi Someone knows, the Selector Name of the Menu Command for 'Rebuild NURBS' ? The only method I know to find it is to delete PlugIns and watch the workspace, which shows the name of the menu command. Any other Methods to find Menu Command. Thanks Dom
  6. Please consider, that the the script takes the area column and calculate the square with that. If you have a language settings with comma instead of points for decimal seperator, the calculation will fail. Use points as decimal separator or eliminate decimal places in your list.
  7. Negative ... I use Vectorworks 2018 SP1 German Version. Mac OSX 10.12.6. Same issue with the above url.
  8. 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: 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 = '' #missngLibURL = '' missingLib = 'PIL' # 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 =[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
  9. 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 = '' 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 = '' matplotlibPath = '' Also Scipy, Numpy Why of all things "Pillow" :-( Is there any alternative?
  10. 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
  11. 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
  12. 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.
  13. 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
  14. O ... K :-) cool, great hint