Jump to content

twk

Member
  • Posts

    877
  • Joined

  • Last visited

Everything posted by twk

  1. this has worked for me in the past. The variable passed in must strings in a tuple, be a type <tuple>. testing for classes, but can pass any handle that can be tagged (layer, etc): def tagthis(handle, value): if type(value) is tuple: vs.SetObjectTags(handle, value) elif type(value) is list: vs.SetObjectTags(handle, tuple(value)) elif type(value) in [str, float, int]: vs.SetObjectTags(handle, (str(value),)) else: raise ValueError("Incorrect type for Tags : <{}>".format(type(value))) h = vs.GetObject('TestClass') tagthis(h, ('tag1', 'tag2')) Just tested in VW2023 and VW2024, all working on this end
  2. 1) For your first post: The second parameter for the ForEachObject must be a criteria string. so: vs.ForEachObject(sel, "T=RECT" & "T=NURBSCURVE") should actually be written as: vs.ForEachObject(sel, '"T=RECT" & "T=NURBSCURVE"') 2) For your most recent post: why are you using VSEL and SEL? shouldn't just SEL work? tips: You could place criteria strings in variables: crit_string_1 = '"T=RECT" & "T=NURBSCURVE"' so it would be: vs.ForEachObject(sel, crit_string_1) and also leveraging pythons f-string capabilities: type_1 = 'RECT' type_2 = 'NURBSCURVE' crit_string_1 = f'"T={type_1}" & "T={type_2}"'
  3. @Poot, yes have saved views in file, still no luck. Have you got it to work?
  4. Great! @BenjaminGuler Have installed and tried running, but just have blank window when trying to run from the web palette (as per instructions)
  5. @Gunther no place to enter promo code, and no email received either. Keen to see if anyone has actually got the promo to work.
  6. Hmm, this was for 2023 before 2024 came out correct? Has anyone got the free promo to work? it isn't clear in the customer portal. It says click promo code, but that just takes you to a help file location on loggin in. No promo code provided. @Gunther any idea how to test this? Cheers and happy new years!
  7. Ha!, Great minds think alike! Have implemented this as well. However the data manager settings are sporadic with project shared files. Sometimes saving and sometimes not. Continuing to test this.
  8. Yes this is the work around we use at the moment. Wondering if we could tag an object or data tag, restricting tags to a certain class
  9. Too little time to troubleshoot/read help file, anyone knows if its possible to tag objects based on their class? I have a generic data tag style setup that reports the area of any tagged object, however I want to only tag my footpaths, (classed as SITE-Foot Paths). Is this possible?
  10. Ahh looks like Archicad beat VW to the punch..
  11. 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
  12. 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
  13. 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
  14. 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.
  15. 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
  16. I believe theres already a workflow for this when you;re importing dwg's. Check under Advanced DWG Import Options > Classes/Layers > Mapping Set.
  17. 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?
  18. Check that "Enable click-drag drawing" is disabled (Under the Vectorworks preferences)
  19. 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.
  20. 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.
  21. 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
  22. 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)
  23. 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.
×
×
  • Create New...