Patrick Winkler

  • Content count

  • Joined

  • Last visited

Community Reputation

36 Great


About Patrick Winkler

Personal Information

  • Occupation
    Software Developer
  • Homepage
  • Location

Recent Profile Visitors

875 profile views
  1. Hi callum, try it with ResetObject(handle)
  2. Hans, you just mentioned the solution. I forgot that there is a transfrommatrix-node. The Rotate3D node could be fixed by checking the type for PlugIn objects and using TransfMatrix in case. (@Marissa Farrel :))
  3. Run it in 3D view and it will rotate.
  4. Hi Hans, could you provide a vwx file to reproduce the problem.
  5. Hello together, when using the pydev debugger I noticed that vs.Handle provides some attributes that make scripting a bit more comfortable. Hopefully more attributes will follow. def test(): vs.CreateText('Hello!!') h = vs.LNewObj() print ('Type', h.type) print ('Parent', h.parent) print ('Parent Type', h.parent.type) regards, Patrick
  6. @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): def get_SymDefs_in_File (): ''' Returns all Symbol-Definitions as list found in the active Document. ''' syms = [] SYMBOL_DEFINI_TYPE = 16 CURRENT_DOC = 0 Res_List, NumItems = vs.BuildResourceList (SYMBOL_DEFINI_TYPE, CURRENT_DOC, '') for i in range (NumItems): # Die Resourcelist beginnt nicht wie üblich mit dem Index 0 sondern mit 1 i += 1 h = vs.GetResourceFromList (Res_List, i) syms.append ( vs.GetName(h)) return syms ### this = Marionette.Node( 'Get Sym' ) sym_list = get_SymDefs_in_File () sym_popUp = Marionette.OIPControl( 'Syms', Marionette.WidgetType.Popup, 0, sym_list) sym = Marionette.PortOut() def RunNode(self): sel_idx = self.Params.sym_popUp.value self.Params.sym.value = self.Params.sym_popUp.popupChoices[sel_idx] Unfortunately you have to run it to refresh the popup values.
  7. I've changed the to make it capable of showing the exceution order. I think this can also be helpfull in other cases then global var handling. You have to replace the inside the marionett plugin by the attached one (on your own risk). It only shows the order on the first outport if there is a vw class named 'mrnt_show_order' in the doc otherwise it shows the number of output values as usual.
  8. I hope meanwhile you found time to finish your script. I'm still curious about your solution.
  9. Hi Dom, handling global vars looks like a dangerous thing to me. You have to be very carefull when connecting the nodes because it can change the flow of the network (first connected -> frist executed) which may lead to inconsistent values. (global var is accesed before assigned...). It seems that the flow also depends on the node from which you run the network. I've attached an example. regards global_var_test_v2017.vwx
  10. You got it pat I could solve it by replacing the += with .append: def RunNode(self): dir = self.Params.dir.value obj = self.Params.obj.value a = 0 b = self.Params.step.value c = self.Params.count.value list = [] if c != 0: list = [a+n*b for n in range(c)] objs = [] for i in range(len(list)): if dir == 0: objs.append (vs.HDuplicate(obj, list[i], 0)) # Changed += to append elif dir == 1: objs.append (vs.HDuplicate(obj, 0, list[i])) # Changed += to append self.Params.array.value = objs The node creates 5 duplicates so you get 6 object s in total at the end. The original was not passed out the Linear Array node. I appended a Delete-node to the Line-node, maybe you want to at it rather to the output list of linear array. regards
  11. Thanks pat. I needed some attempts to get back from the str to the vs.Handle. The cells get filled with this code: h = vs.WSScript_GetObject() h_str = str(h) vs.WSScript_SetResStr(h_str) Then another script iterates trough all objects and compares the handle strings: def get_handle_from_str (h_str): h_dict = {} # key: handle_str val: handle def collect_handles(h): nonlocal h_dict h_dict[str(h)] = h vs.ForEachObject (collect_handles, 'All') try: h = h_dict [h_str] except KeyError: print ('Handle could not be found.') h = None print (h_dict) return h # EXAMPLE h = get_handle_from_str ('AEC62080') vs.SetSelect (h) It's kind of unpracticle and carries the risk if inconsistency but it works.
  12. Hi Matt, any Python-IDE can do this. You can either put the next to your other py modules or better add a search path to the project that links to a folder where the is located. Then you have to import it in the modules where vs-functions are called. import vs I use pydev for eclipse. The search path can be added in the project properties.
  13. The only workaround I know is using a dropdown menu instead of the radiogroup. regards
  14. Luckily there's a VectorScript function for calling python scripts: Simply wrap it up the Python code and call it with DoScript. vector_script = "PythonExecute( 'import vs; vs.AlrtDialog("This is a Pythonscript wrapped in a Vectorscript!" )');"
  15. Hi Marissa, sorry I could have mentioned that I tried reading the yellow marked cell with GetWSSubrowCell but it returns me nothing. My goal is to get the handle to the door-row from the worksheet so that I can read data from the ws in write it in a record of the door. regards