Jump to content

twk

Member
  • Posts

    874
  • Joined

  • Last visited

Posts posted by twk

  1. 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}"'

     

    • Like 2
  2. 7 hours ago, BenjaminGuler said:

    We're working on the Veras integration for Vectorworks. We have the public beta available, and it would be great if we could have more users test it on Mac and Windows.

     

    Here's a link to the release post: https://forum.evolvelab.io/t/veras-vectorworks-release-1-5-1-0-beta/5641

    2024-02-01 14-50-26 - modern design with large windows, interior lights, timber building, during winter, ((snow)), blizzar.jpg

    image.jpg

     

    Great! @BenjaminGuler

    Have installed and tried running, but just have blank window when trying to run from the web palette (as per instructions)

     

    image.thumb.png.c8d19370f03e7f6687c57cd8554d43d4.png

    • Like 1
  3. On 9/18/2023 at 2:49 AM, Tom W. said:

    It appears with VW2024 we have free access to the full library of 1000+ vehicles:

     

    Screenshot2023-09-17at15_46_10.thumb.png.4afc13e8259b88136693118a73dcdb56.png

     

    For 5 months that is...

    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.

    image.thumb.png.1a6e9d5a6ca0205cf4264e9b8822bb55.png

     

    @Gunther any idea how to test this?


    Cheers and happy new years!

     

  4. 9 minutes ago, Pat Stanford said:

    How about temporarily changing Class Visibilities so that only the Footpath is visible and do the tagging.  Then reset the visibilities?

     

    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

  5. 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?

  6. 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

     

    • Like 1
  7. 4 hours ago, MullinRJ said:

    @tui_k,

       Using your code on a Mac I get :

     

    image.png.a3071c3ddf7edc639075aa4429726b3b.png

     

    but I used: vs.CreateRadioButton2(dialog_id, 6, 'Push Button', layer_icon_path)

    instead of: vs.CreatePushButton(dialog_id, 6, 'Push Button')

     

       Perhaps it's a Mac/PC thing. I'll try on a PC, but it may take a while.

     

    Raymond

     

     

     

    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.

  8. 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

     

    • Like 3
  9. 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)

     

    image.png.d8de144e690d5115e2814fe24ae662e5.png

  10. 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.

×
×
  • Create New...