Jump to content

twk

Member
  • Posts

    862
  • Joined

  • Last visited

Everything posted by twk

  1. Ahh looks like Archicad beat VW to the punch..
  2. the path has to be absolute when executing inside vectorworks. Not: filename = "output.csv" leaving it as "output.csv" is telling Vectorworks' python interpreter to save it the installation directory of vectorworks. Try specifying a full path to another location eg. filename = "C:\Temp\output.csv" Also look at DataFrames for python using the pandas module. It has better functionalites for Data Wrangling. You'll need to write your own module for converting a worksheet table to a pandas dataframe, then once its in dataframe format, you can do many things with that dataframe. Export to csv, xls, json, etc
  3. Interesting... Confirming on Windows PC that am having the same behaviour as @WhoCanDo. VW2024 18.10.2023_12.29.12_REC.mp4 VW2023 18.10.2023_12.30.10_REC.mp4
  4. All versioned scripting functions are listed here (for python/vectorscript): https://developer.vectorworks.net/index.php/Vectorworks_Scripting#Version_Information Also the local file shipped with Vectorworks has the ability to see the obsolete functions and functions by Version: <Your Installation Location>\VWHelp\Script Reference\ScriptFunctionReference.html
  5. Try setting it to layer plane vs.SetObjectVariableBoolean(handle, 1160, true/false) you can also set it to a working plane, but I forget the syntax.
  6. to pass back a value to a parameter you use vs.SetRField(plugin_handle, plugin_name, parameter_name, str(value)) the parameter_name here is just the static text parameter you've created or added in the Plugin Definition, set under Plugin-Manger>Edit Definition
  7. I believe theres already a workflow for this when you;re importing dwg's. Check under Advanced DWG Import Options > Classes/Layers > Mapping Set.
  8. It was floated around before, when vectordepot was disbanded (anyone remember that treasure trove? 😁) I've always wondered why the forum resources page didn't get the same treatment the marionette sub-forum got. It's basically got everything you need for any sharing capabilites. - Whats New - Categories - Ratings I mean, the marionette sub-forum page should basically allow any shareable vectorworks resource to be uploaded. I should probably wishlist this @Gunther?
  9. Check that "Enable click-drag drawing" is disabled (Under the Vectorworks preferences)
  10. My testings have shown you dont actually have to restart VW. You just need to open the Plugin Manager, navigate to your plugin/tool, then select "edit definition" or "edit script", then close it, then exit plugin manager.
  11. Much appreciated @MullinRJ. So it looks like it is a windows issue. I've also wondered whether any of the native vectorworks tools implemented that checkbox/radio item image control. Thanks again I shall open a bug ticket for windows.
  12. Vectoworks ships with its own version of Python in a python folder located in the program files (for windows). eg location below: C:\Program Files\Vectorworks 2023\Python39 so in the windows command prompt you navigate there using: cd "C:\Program Files\Vectorworks 2023\Python39" then run this: python -m pip install pandas Note it's recommended that you upgrade pip before installing pandas by running this command (in my examples below my vectoworks install location may be different from yours): C:\Program Files\Vectorworks 2023\Python39>python -m pip install --upgrade pip then you'd install pandas: C:\Program Files\Vectorworks 2023\Python39>python -m pip install pandas
  13. https://developer.vectorworks.net/index.php/VS:CreateCheckBox2 https://developer.vectorworks.net/index.php/VS:CreateRadioButton2 These two dialog control items were added in VW2023, however setting an icon for their display doesn't seem to be working. Previous similar dialog items icons were able to be set by utilising the resource path in the .vwr location, however it doesn't seem to be working for these ones. And also, I can't seem to see an example of this type of control in any vectorworks' dialogs in any of their stock tools/commands. If you look at my code below, the vs.CreateImagePushButton dialog control seems to work by using the icon path 'Vectorworks/Images/Standard Images/Layers.png', however that same path doesnt work for either CreateCheckBox2 or CreateRadioButton2. Anyone have any ideas before I open a bug ticket? @JBenghiat @MullinRJ @Jesse Cogswell @Vlado @Pat Stanford import vs layer_icon_path = 'Vectorworks/Images/Standard Images/Layers.png' SetupDialogC = 12255 # A predefined constant value that is passed to the dialog event handler subroutine when a modern custom dialog is initially displayed onscreen. SetdownDialogC = 12256 # This constant is passed to the event handler routine to signal dialog setdown. ResizeDialogC = 12611 # This constant is passed to the event handler routine to signal the dialog has been resized. DisplayDialogHelpC = 12916 # This constant is passed to the event handler routine to signal the dialog that it should display its contextual help using the help string given by the Contextual Help Manager menu. DialogTimerEventMessageC = 13028 # This constant represents the message that is sent periodically to a dialog handler after it has been registered to receive timer events. LeftButtonC = 12605 # This constant is used as a control ID when a button must appear in the lower left corner of a dialog. dialog_id = vs.CreateLayout('Dialog Icons Test', False, 'Ok', 'Cancel') vs.CreateCheckBox2(dialog_id, 5, 'Image TextBox', layer_icon_path) vs.CreatePushButton(dialog_id, 6, 'Push Button') vs.CreateImagePushButton(dialog_id, 7, 50, layer_icon_path) vs.SetFirstLayoutItem(dialog_id, 5) vs.SetBelowItem(dialog_id, 5, 6, 0, 0) vs.SetBelowItem(dialog_id, 6, 7, 0, 0) def dialog_handler(item, data): if item == SetupDialogC: pass elif item == 1: pass elif item == 2: pass vs.RunLayoutDialog(dialog_id, dialog_handler)
  14. If you have workgroup folders setup or favorites, we've found that the startup process takes longer. especially when our favorite files contained large images resources for textures etc. Try removing these temporarily to see if it fixes it. (the favorites and workgroup folders) On windows by the way.
  15. As others have stated, we;re limited with the vectorscript/python implementations provided by vectorworks. What I have done with other similar plugins, is a menu item that runs a script looking for changes across the document and updating relevant/linked plugins as needed.
  16. Yep have filed a bug (VB-196628), but it wasn't just my workspace. Even with the stock workspaces, once you edit the stock workspace and nest any of those tools (doesnt have to be all of them) it will cause the crash when exiting the Edit contours mode. I'll try and find time for a demo video illustrating.
  17. Well well well.. just spent the last 3 hours diagnosing what was happening and causing the crash. Turns out it wasn't: - a converted workspace - custom short cut keys for my workspace - or any custom plugins I had The Trial and Errors Before I unveil the culprit and the solution, share in my grief that which I painstakingly tried. (Side note, there were other anomalies found that were causing other crashes) : 1. Converted multiple stock workspaces (ANZ, ANZ-BIM) 2. Removed all shortcut keys 3. Editing Tools and Menu Items to add our set of custom office shortcut keys 4. Re-organised icon positioning and stacking within palettes to match our previous office workspace setouts. Test actions to trigger the crash 1. Editing or just entering the contours space, for the -> Grade Limit Site Modifier's 'Define by Contours' 2. Upon exiting, Vectorworks crashes SiteModelEdit_Crash.mp4 The culprit(s): - Stacking Tools used in this mode (Reshape, Split, Trim, Clip, Pan, Zoom, and others). 1. If these tools are stacked in my workspace it will cause the crash. They must be at the top most level in the tool palette 2. When you're in this contour edit mode of the Grade Limits site modifier, you can see that these tools are not stacked beneath anything The solution: After all that testing, all I had to do was make sure that my custom workspace had these particular tools 'unstacked'. Ie not nested under another tool. If anyone has a spare moment can you test this by in your own workspace, nest one of these tools (any in my experience) and see if it crashes. @Matt Panzer, @Vlado, it looks like the Contour Edit Palette above is causing some issues, I shall file a bug.
  18. Apologies looks like there was an extra line after the 'while' call. correct below: # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(excluded_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if excluded_layer_names: if layer_name not in excluded_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names
  19. You know what, I misunderstood your question. You're wanting an excluded list. We'll revise the 'list_sheet_layer_names' function that accepts a list of sheets to be 'excluded' as a parameter. # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(excluded_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: layer_names.append(hLayer) if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if excluded_layer_names: if layer_name not in excluded_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names then when you run the iteration, you provide the list of sheet names you want excluded: # Iterate through all sheet layers in the current document # Say you want to exclude sheets 01, 05, 10, 12 for layer in list_sheet_layer_names(['01', '05', '10', '12']): # Define criteria strings to find title blocks and viewports on the current layer titleblock_crit_str = f"(((L='{layer}') & (PON='Title Block Border')))" viewports_crit = f"(((L='{layer}') & (T=VIEWPORT)))" # Use the get_objects_from_criteria() function to get lists of title blocks and viewports on the current layer titleblocks = get_objects_from_criteria(titleblock_crit_str) viewports = get_objects_from_criteria(viewports_crit) <<< RESET OF CODE >>
  20. Good point @Pat Stanford. My workspace is probably converted from 2021 if I can recall correctly. It's strange though, editing the contours and updating the site model works fine if I'm on the Architect workspace, as soon as I change the workspace to my converted one, and then try to edit/update the contours through the grade limit, it crashes. And this is all within the same session. I would've thought the tools or the operations that run in the background are not dependent on anything stored in the workspace. But all good, will re-do a fresh workspace, it is about time.
  21. Reporting back again, that the culprit is my workspace. If I use my custom workspace, it crashes, if I use one of the stock vw workspaces its fine. Off to the bug reporting department.....
  22. Reporting back that a fresh re-install of VW23 seems to have fixed it. Thanks all for testing
  23. there was a mistake in the indent blocking for the last line of the loop, the hLayer = vs.NextLayer(hLayer) shouldn't be nested in the else portion. Fixed below: # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(filter_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: layer_names.append(hLayer) if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if filter_layer_names: if layer_name in filter_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names
  24. revised list_sheet_layer_names below, added option to provide a list of layernames you want to only be returned. # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(filter_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: layer_names.append(hLayer) if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if filter_layer_names: if layer_name in filter_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names
×
×
  • Create New...