Jump to content

twk

Member
  • Content Count

    526
  • Joined

  • Last visited

Community Reputation

158 Spectacular

5 Followers

About twk

  • Rank
    500 Club

Personal Information

  • Occupation
    Architectural Designer
  • Homepage
    www.cba-design.co.nz
  • Location
    Auckland, New Zealand

Recent Profile Visitors

2,120 profile views
  1. 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]:
  2. 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:])
  3. 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?
  4. Below is a video of the new engine. Even though I'm a Lumion user, this looks pretty impressive.
  5. twk

    Updating Record from Excel Spreadsheet

    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
  6. twk

    Until Next Time

    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!
  7. 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
  8. twk

    List All Classes in file

    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)
  9. twk

    List All Classes in file

    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)
  10. twk

    Database CAPITALS

    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
  11. twk

    Database CAPITALS

    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
  12. twk

    Railing/Fence Tool

    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..
  13. Pretty amazing what these guys are doing. https://twitter.com/Test_Fit_io
  14. I remember seeing the 2016 Marionette video about cladding walls.. looked so promising, until I tried it myself. Short answer : a short endeavor..
  15. twk

    Vectorworks to Twinmotion

    Oh you definatley should check out @JRA-Vectorworks-CAD's work. Youtube channel here: https://www.youtube.com/channel/UC56qp6QeXSAayDOOHu3BcCA

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×