Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by twk

  1. True, analysis method looks pretty cool. No luck with converting to subdivision though.
  2. Care to share just the model portion of the file? Willing to have a crack at it as well. What about converting it to subdivision and using the split mode?
  3. twk

    Idiot DTM question

    Quite a massive Site Model there! I wonder weather the GIS Map capabilities inside vectorworks would have better satellite imagery
  4. twk

    Idiot DTM question

    Options that come to mind are: 1. A texture bed tracing the water edge 2. A large slab/floor object just above water level, with opaque texture
  5. Thanks Pat, those seem to be calls for fields on the datasheet for the object, not the actual custom record.
  6. Does anyone know which function calls to use for setting record fields to be controlled by the data manager field mapping. Have just setup a data mapping for a particular record to WinDoor objects, and they seem to work -- manually, however I have the records already attached to some odd 200 objects. Have tried vs.SetParamStyleType, put that seems to be only for plugin objects, not records. Any help, or pointers in the right direction would be greatly appreciated. Cheers, Tui
  7. On a side note, heres a snippet that lists out all installed modules for your python environment (adapted for vectorworks, by adding vs.CreateText(), to be run on design/sheet layer). def list_modules(): import pkg_resources installed_packages = {d.project_name: d.version for d in pkg_resources.working_set} # print(pkg_resources.working_set) text_data = [] for k, v in installed_packages.items(): # print(f"{k} : {v}") text_data.append(f"{k} : {v}") import vs vs.CreateText(f"{vs.Chr(13)}".join(text_data))
  8. Are you on Mac? I've heard somewhere that Tkinter may need to be installed separately as its own package on the MacOS. On my windows one, it comes with Python3.8 that ships with Vectorworks
  9. Set Fill Pattern to 0 https://developer.vectorworks.net/index.php/VS:SetFPat
  10. @Christiaan, I did think about it!
  11. Well I'll be, that actually should've said 'checking' subset fonts. Thanks @JMR
  12. You could try batch processing through worksheets. Creating Database rows for your Titleblock Records. The new VW Titleblocks also support adding you're own custom fields. So that may help?
  13. Just spent the past 3 hours trying to figure this out.... Should have searched here first!! Thanks @DomC/ @Julian Carr !
  14. GetLName returns the name of the referenced layer, eg. # the current design layer name = 'Layer 1' # to get a handle to the active layer, you'd use vs.ActLayer() layername = vs.GetLName(vs.ActLayer()) vs.AlrtDialog(layername) # should display 'Layer 1' I think what you're after is vs.GetLayer(HNDL). https://developer.vectorworks.net/index.php/VS:GetLayer and then vs.GetLName eg h = vs.FSActLayer() layer_name = vs.GetLName(vs.GetLayer(h)) # vs.GetLayer(h) returns a HANDLE to the layer the object 'h' belongs to
  15. The error is saying your indentations are inconsistent/incorrect. Indentations are important for python. You must either use 4-spaces, or a single TAB, you can't use both in one script. try this: for a in range (4): # vs.CreateWS('WS_TEST'+a+',2,2') worksheet = vs.GetObject(vs.Concat('WS_TEST',a)) if worksheet not in [None, 0]: vs.CreateWS((vs.Concat('WS_TEST',a)),2,2) vs.SetWSColumnWidth((vs.Concat('WS_TEST',a)),1,1,50) vs.SetWSColumnWidth((vs.Concat('WS_TEST',a)),1,1,20) vs.SetWSRowHeight((vs.Concat('WS_TEST',a)),1,1,20,0,0) vs.SetWSRowHeight((vs.Concat('WS_TEST',a)),2,2,20,0,0) vs.SetWSCellFormulaN((vs.Concat('WS_TEST',a)),1,1,1,1,a)
  16. Unfortunately I am not a Mac user. In windows it's found in the installation location of vectorworks, under: # C:\Program Files\Vectorworks 2021 NZE\Python38
  17. is there a nil object in python? In any case, for handle error checking I normally use: # based on your example worksheet = vs.GetObject('WS_TEST') if worksheet not in [None, 0]: vs.CreateWS(('WS_TEST'), 2,2)
  18. As @Pat Stanford suggested, the vectorscript editor should be adequate for marionette editing. I personally use PyCharm. Much more robust, for actual plugin development, version control, managing external libraries as well. They have Windows and Mac versions as well https://www.jetbrains.com/pycharm/download/#section=windows
  19. There's a great resource on this on the Dev Wiki by @_c_. https://developer.vectorworks.net/index.php/User:CBM-c-/VS-List_Browsers_part_1 It is one of the last frontiers for me to tackle for vectorworks scripting.. a bit of a read, but very well documented.
  20. Ah, @BillW, these are great. Much cleaner to implement as well.
  21. I'm not sure the function itself shortens the variable 'p'. It overrides it completely with whatever the GetPolyPt or any other function spits out. Which in the case of the GetPolyPt is a 2-dim tuple. So in the case of the vs.Vec2Ang() function, that particular function 'requires' a 3-dim tuple, when you are passing values from GetPolyPt into the Vec2Ang function you'd have to unpack the values you get from GetPolyPt and add a 3rd value. p = vs.GetPolyPt(handle_to_poly, 1) ang = vs.Vec2Ang((p[0], p[1], 0)) # the third value 0 is added by you I think we are coming to the same conclusion, I'm just a bit thrown off by your original post stating "If you passed some z values before in the third slot, you'll loose them". From my knowledge whatever 'p' was before you set it is overwritten with this new value and type. I also just saw your commenting on the DevWiki which explains things very clearly.
  22. I'm not following. Maybe this is a python thing, but the value of your variable 'p' gets overwritten once you set it to vs.GetPolyPt(vs.FSActLayer(), 1). The GetPolyPt function always returns a tuple of 2 values. So whatever 'p' was before will become whatever GetPolyPt gives it. eg. p = "Hello there" print(p) # "Hello there" p = (0,1,2) print(p) # "(0,1,2)" variables in python are dynamically typed.
  23. I use the McLeonards one for 2D vector calcs at the moment. For scalars and other basic arithmetic with vectors. Never seen the 3D one before, looking through it now. Thanks for the share!
  • Create New...