Jump to content

twk

Member
  • Posts

    701
  • Joined

  • Last visited

Reputation

295 Spectacular

5 Followers

Personal Information

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

Recent Profile Visitors

3,930 profile views
  1. Thanks Pat, those seem to be calls for fields on the datasheet for the object, not the actual custom record.
  2. 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
  3. 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))
  4. 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
  5. Set Fill Pattern to 0 https://developer.vectorworks.net/index.php/VS:SetFPat
  6. @Christiaan, I did think about it!
  7. Well I'll be, that actually should've said 'checking' subset fonts. Thanks @JMR
  8. 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?
  9. Just spent the past 3 hours trying to figure this out.... Should have searched here first!! Thanks @DomC/ @Julian Carr !
  10. 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
  11. 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)
  12. 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
  13. 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)
  14. 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
×
×
  • Create New...