Jump to content

twk

Member
  • Posts

    877
  • Joined

  • Last visited

Everything posted by twk

  1. Oh ok, we don't have SP4 version for New Zealand yet. On another note, I'm wondering how the script works even though the vs.PushAttrs and vs.PopAttrs are syntactically incorrect. They should have parenthesis' -> vs.PushAttrs() and vs.PopAttrs()
  2. Tried in VW2018 SP6 and VW2019 SP3, there are no instances of the error you showed in the video.
  3. Any chance of a code snippet you can provide?
  4. Oh I was just diving into the world Listbrowser(s). It's down again.. any reason @Matt Panzer this can't be hosted on the Dev Wiki?
  5. the vs.AddSurface result is either a handle if surfaces overlap, or None/0 if the added surfaces don't overlap. I provided error checking on line: if add not in [0, None]:
  6. Got it to work! # Disclaimer: no responsibility taken for data loss. Code responsibly, save often. def addsurface_from_list(objs_list:list): # where objs_list is a list of object handles of rectangle/polygon/arc/etc.. if len(objs_list) > 0: fobj = objs_list[0] for o in objs_list[1:]: add = vs.AddSurface(fobj, o) if add not in [0, None]: objs_list.remove(o) objs_list.append(add) break addsurface_from_list(objs_list[1:])
  7. The Addsurface function only takes in two handles. How would you do a list of handles? As per screenshot below: where some rectangles are overlapping and some aren't? using Addsurface in a for loop seems impossible as once the surfaces are added h1, h2 are deleted. Thoughts anyone?
  8. Below is a video of the new engine. Even though I'm a Lumion user, this looks pretty impressive.
  9. I've never been able to get this to work, do you have a short step-by-step description of how you've gotthen the ODBC to work? -- edit -- BTW, I use to the openpyxl python module to talk between vectorworks and excel. If only there were better documentation on the external databases connection process for VW Cheers, Tui
  10. Wow... was not expecting this at all!?... Vectorworks' loss for sure! In any case, you have set the standard for customer/user support for any company. All the best in your future endeavors!
  11. If you're looking for viewport class visibilities, they're under the 'Group' category in the DevWiki. http://developer.vectorworks.net/index.php/Category:VS_Function_Reference:Objects_-_Groups They have viewport layer visibility getters and setters there as well. Cheers, Tui
  12. Heres another one that lists them all in one text object, adding the option to show the stacking order number with it or not. -- Save your work before using -- get_layer_type = lambda x:vs.GetObjectVariableInt(x, 154) # 1 = Design Layer, 2 = Sheet Layer, 3 = Referenced Layer get_layer_type_switch = 0 #Custom switch, change to get different layer types 0=Design Layers Only, 1=Sheet Layers Only, 2=Both Design Layers and Sheet Layers show_stacking_order = False #Set to True if you want the string to show the stacking order number beside it font_size = 10 layer_names = [] hLayer = vs.FLayer() while hLayer != None: layer_type = get_layer_type(hLayer) if get_layer_type_switch == 0: if layer_type == 1: layer_names.append(vs.GetLName(hLayer)) elif get_layer_type_switch == 1: if layer_type == 2: layer_names.append(vs.GetLName(hLayer)) elif get_layer_type_switch == 2: layer_names.append(vs.GetLName(hLayer)) hLayer = vs.NextLayer(hLayer) # we now reverse sort the layer_names list. For some reason this method retrieves layers in reverse order of the stack shown in the Navigation Pallette. layer_names.reverse() text_str = "\r".join([str(x) for x in layer_names]) if show_stacking_order: text_str = "\r".join(["[{}] {}".format(i, x) for i,x in enumerate(layer_names)]) vs.CreateText(text_str) TEXT = vs.LNewObj() vs.SetTextVerticalAlign(TEXT,3) vs.SetTextJust(TEXT, 1) vs.SetTextSize(TEXT, 0, len(vs.GetText(TEXT)), font_size)
  13. Swap out integers for the get_layer_type_switch, to retrieve a list of either Design Layers, Sheet Layers or Both. -- Save your work before using -- get_layer_type = lambda x:vs.GetObjectVariableInt(x, 154) # 1 = Design Layer, 2 = Sheet Layer, 3 = Referenced Layer get_layer_type_switch = 0 #Custom switch, change to get different layer types 0=Design Layers Only, 1=Sheet Layers Only, 2=Both Design Layers and Sheet Layers layer_scale = vs.GetLScale(vs.ActLayer()) # page mm scale 1:1 spacing = 3 * layer_scale font_size = 10 layer_names = [] hLayer = vs.FLayer() while hLayer != None: layer_type = get_layer_type(hLayer) if get_layer_type_switch == 0: if layer_type == 1: layer_names.append(vs.GetLName(hLayer)) elif get_layer_type_switch == 1: if layer_type == 2: layer_names.append(vs.GetLName(hLayer)) elif get_layer_type_switch == 2: layer_names.append(vs.GetLName(hLayer)) hLayer = vs.NextLayer(hLayer) # we now reverse sort the layer_names list. For some reason this method retrieves layers in reverse order of the stack shown in the Navigation Pallette. layer_names.reverse() text_objects = [] for layer_name in layer_names: vs.CreateText(layer_name) TEXT = vs.LNewObj() # set text vertical align and horizontal align = center, left vs.SetTextVerticalAlign(TEXT, 3) vs.SetTextJust(TEXT, 1) vs.SetTextSize(TEXT, 0, len(layer_name), font_size) text_objects.append(TEXT) for i, text in enumerate(text_objects): if i != 0: prev_text = text_objects[i-1] prev_text_bbox = vs.GetBBox(prev_text) vs.HMove(text,0,(prev_text_bbox[1][1])-spacing)
  14. Hi @John Meunier, Looks like a glitch in the matrix.. - Any other formula added to that glitching cell doesn't work. - If I copy the formula out, then replace it with the cell's formula next to it. The worksheet starts to function again. - Now I can copy back in the first formula I had (or you wrote), and it recalculates fine. 2019-03-14_13-24-08.mp4
  15. There is no native way to do it. But you could with a script. 1. Create a script in your file name it 'WS_ALL_CAPS' . (When it asks you to create a palette, just name the palette whatever you want, something like 'WS Scripts' will suffice. 2. When the script dialog box pops up, change the language to Python. 3. Use the code below in your script: orignal_str = vs.WSScript_GetPrmStr(0) vs.WSScript_SetResStr(orignal_str.upper()) 4. Now back in your worksheet, select the cell you want capitalized. Enter this into the formula bar: =RUNSCRIPT('WS_ALL_CAPS', 'Existing Tree'.'ActionComment') 5. Recalculate Active Worksheet
  16. Just as a follow up to my previous post being for a 3rd party Addon to Archicad, the actual native Handrail tool in Archicad is something to be envious of as well..
  17. Pretty amazing what these guys are doing. https://twitter.com/Test_Fit_io
  18. I remember seeing the 2016 Marionette video about cladding walls.. looked so promising, until I tried it myself. Short answer : a short endeavor..
  19. Oh you definatley should check out @JRA-Vectorworks-CAD's work. Youtube channel here: https://www.youtube.com/channel/UC56qp6QeXSAayDOOHu3BcCA
  20. After extruding a circle, you can user-adjust position of top or bottom end of cylinder by activating the "ReShape" Tool command. (highlighted tool in screenshot below)
  21. Wondering how 2019 does it with titleblock data being able to read TB info from another file? Could not find any related functions for opening one file in another file in the DevWiki or the SDK files.
  22. Greetings and happy new year all, I was wondering if there was anyway to access plugin data from a file other than the active one? Wanting to read in data from a plugin object that resides in another file. Cheers, Tui
  23. This I can relate to.. on the other hand, surley Teamviewer sessions with Vectorworks Tech support would be much faster/cheaper/easier then bug submissions/phone calls/site visits? I should probably wishlist this..
  24. Is there a maximum number of layers you can map onto an IFC Story? See GIF below: I can't attach those last few layers to the IFC story. Also is there any way to export these settings? When we click save setting where does it get saved to?
  25. Here I created a custom object class: (tested and worked in VW2016) # save work before using def SetClassGroup_Contents(handle_to_group, className:str, descend=False): class CustomObject(): def __init__(self, handle): self.handle = handle self.__old_class = vs.GetClass(self.handle) @property def old_class(self): return self.__old_class @old_class.setter def old_class(self, value): self.__old_class = value @property def obj_class(self): return vs.GetClass(self.handle) @obj_class.setter def obj_class(self, value): vs.SetClass(self.handle, value) def restore_old_class(self): self.obj_class = self.old_class if vs.GetTypeN(handle_to_group) == 11: # Only work on groups TypeGroup == 11 if not descend: # if descend parameter set then cycle through each item in group, default is set to false stored_objects = [] #type: list[CustomObject] def set_class_objs_in_group(h): stored_objects.append(CustomObject(h)) vs.ForEachObjectInList(set_class_objs_in_group,0,1,vs.FInGroup(handle_to_group)) # See Documentation for parameter descriptions vs.SetClass(handle_to_group,className) # Set Class of overall group for object in stored_objects: object.restore_old_class() else: vs.SetClass(handle_to_group, className) # Set Class of overall group vs.ReDrawAll() # Sometimes my machine needs this to show updated attributes vs.ResetObject(handle_to_group) # Updates Object Info Pallette h = vs.FSActLayer() SetClassGroup_Contents(h,'NewClass1') # Use for apply to group only # SetClassGroup_Contents(h,'NEW CLASS', True) # Use for apply to group and contents
×
×
  • Create New...