Jump to content

twk

Member
  • Posts

    701
  • Joined

  • Last visited

Everything posted by twk

  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
  15. 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.
  16. Ah, @BillW, these are great. Much cleaner to implement as well.
  17. 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.
  18. 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.
  19. 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!
  20. Maybe comparing The Gaming Experience/Industry vs The AEC Industry is an apples vs oranges comparison. What the UE5 release is showcasing really, is a bit more to do with how the developments in gaming software (ie Unreal Engine) has caught up-to, and surpassed, both the Film and AEC industry and actually leading the charge now in technology foresight. It's more of, there is now a gaming engine, which CAN accurately hold and display REAL-WORLD data on the fly, with minimum computing power. Which has effects in the real world in our industry. Overturning the traditional workflows of large studios, render farms, render times, etc. Everyone is having to rethink things. An architectural firm, which used to outsource renders to a specialised archviz studio, can now do it in-house, with renders that only take a day for videos flythroughs, seconds for still images. Real-world context can now be imported at the click of a button.. no more time-consuming travelling to site, etc. eg below. Theres a lot that what Unreal as a company is doing that will potentially change how we do things.
  21. I think you raise fair points. And to be honest, we HAVE been hearing and seeing virtual reality since the early 90s. Yet the industry (AEC) has yet to fully adopt it in that time. At the moment, I do believe CAD is still needed in the meantime, ONLY because the medium with which we are transferring our designs to site is still in 2D format. PDF's, printed drawings etc. And sure with the advent of HoloLens and other AR solutions, the game is looking more and more adaptable to change. Some notable things with the UE5 release, is that these are things that we're never though possible with current gen specs, let alone, consumer grade specs. It's the accessibility for those on lesser budget/team that is eye-opening.
  22. I believe it still is there, cos as you're exporting models/materials/assets to Unreal engine, all the geometry and BIM Data is in the Unreal project file. The 'magic' I believe on display (no pun intended), is that all that info is not accessed/visible until the user needs it. Sort of like streaming for online videos.
  23. Also, whenever I think of something showing up as just hype (bitcoin, crypto, NFT's, metaverse), I think of articles like this:
×
×
  • Create New...