-
Posts
458 -
Joined
-
Last visited
Reputation
251 SpectacularPersonal Information
-
Location
United Kingdom
Recent Profile Visitors
4,484 profile views
-
Thanks guys. I'll try and have a go at installing it now, as I need to roll this out ASAP, but it may have to wait for 25 U2. The issue is that I can't find a wheel file for Tkinter, but there are probably other ways of doing it.
-
Hello, I'm using a 3rd party UI library based on Tkinter for my plugin (internal to my company only, not commercial), because it's quite complex and would be painful to do in the standard Vectorworks dialogs. The plugin runs great on Windows - no issue at all. But on Mac, I get the error that something related to Tk in Python 3.9 is missing/wrong. Traceback (most recent call last): File "<string>", line 3, in <module> File "<string>", line 1, in <module> File "<string>", line 1, in <module> File "<string>", line 1, in <module> [Previous line repeated 46 more times] File "<string>", line 8, in <module> File "/Applications/Vectorworks 2024/Vectorworks 2024.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/ init .py", line 37, in <module> import _tkinter 4 If this fails your Python may not be configured for Tk ImportError: dlopen(/Applications/Vectorworks 2024/Vectorworks 2024.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynloadLtkinter.cpython-39-darwin.so, 0x0002): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.9/lib/libtc18.6.dylib Referenced from: <D34AFA3C-4A61-34E2-9E86-5F5A9865C714> /Applications/Vectorworks 2024/Vectorworks 2024.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynloadLtkinter.cpython-39-darwin.so Reason: tried: 1/Library/Frameworks/Python.framework/Versions/3.9/lib/libtc18.6.dylib' (no such file), ./System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.9/lib/libtc18.6.dylib' (no such file), ./Library/Frameworks/Python.framework/Versions/3.9/lib/libtc18.6.dylib. (no such file), '/usr/lib/libtc18.6.dylibs (no such file, not in dyld cache) Just looking for advice on the way forwards please - is the Vectorworks Python implementation in Mac known to be different from Windows?
-
To a certain extent this sounds possible with scripting at the moment, but it gets challenging when you hit a device that has multiple possible inputs. If Computer A and Computer B were both connected to Switch B - it would be impossible, even by script, for Vectorworks to know that the signal for Camera X came from LANPOE3 not LANPOE1. It simply doesn't have any information on what goes on inside a Device, nor can it estimate. If you really wanted to make this work, I could see a few options to consider. 1 - infer it from network design. If you gave all of the LAN ports information about their IP/Subnet and the computers and Camera also had that information, you could potentially deduce via script which sources might be on the same subnet as your camera. You'd need to handle the case where multiple things could be the source, though. 2 - add some per-socket information to say which 'other' socket a given socket is linked to, that a script can then pick up. i.e. for LANPOE2 (the one connected to Camera X, as you have two) you could have a field to input that it's linked to 'LANPOE 3'. It might be possible to do this with a drop down, but presuming you're in Python, you could still add some logic to try to fuzzy-match it if a direct match isn't found (i.e. ignore case, ignore spaces etc.). You'd obviously have to remember to update this if the source was moved to a different socket on that device. I can see duplicate socket names in your switch above, which would 100% need fixing before any of this, though I get that it's just a mock up example. Indeed, I'd probably make routine #1 in the script to scan all devices for duplicate sockets and stop the process if one is found until the user fixes it.
-
I have only used Python so haven't tried with Vectorscript directly, but for Python, I do find it useful for two tasks. I tend to use it at the start and the end of writing a plugin. When opening up a fresh Python file that I know is going to end up a few hundred lines long, sometimes it's hard to break the 'writer's block' and get started on the first line. I use it to give me a rough outline and structure. I then review anything that needs to change about the structure (i.e. whether there are slicker options for iterations, like ForEachObject), but generally it does a reasonable job. I then swap any Vectorscript functions it has fabricated itself for something workable. Then, I find it useful when there's an annoying issue I just can't trace, i.e. debugging why something just won't exit a loop even though everything is telling me it should. It won't get it every time but it gets it often enough for sure.
-
@Jesse Cogswell apologies, I forgot to come back here and say thanks so much for this. Your option #1 works brilliantly.
-
Here's a quirky one. I would like to have my python script query data from our Microsoft 365 tenant. I have this working fine in my standalone python desktop app, but I'm running in to an issue in a VW script context with loading a browser. The msal library for python deals with secure tokenised login to 365. You call the command 'acquire_token_interactive' and it should launch a browser for you to authenticate with your tenant credentials. Once you've logged in to your company 365 tenant as you, the browser closes and hands the token to your script for your session. The issue is that it seems when it's time for the browser to launch, Vectorworks crashes. I don't really mind whether it opens the default WebDlg or can be re-directed to an external browser. Here is my code. I get the AlrtDialog of 'attempt interactive', and then VW quits. Does anyone have any ideas that might stop Vectorworks crashing and allow the browser to open please? import vs import logging from io import BytesIO import Marionette lib_OK = False try: import msal lib_OK = True except: msal_whl = "https://files.pythonhosted.org/packages/ab/82/8f19334da43b7ef72d995587991a446f140346d76edb96a2c1a2689588e9/msal-1.30.0-py3-none-any.whl" bool = Marionette.VerifyOrGetLib("msal",msal_whl) if lib_OK: import requests class Ctrller_365_Client: def __init__(self): self.app = msal.PublicClientApplication( client_id="redacted for forum", authority="redacted for forum", token_cache=msal.SerializableTokenCache() ) vs.AlrtDialog('auth app exists') self.token = None def authenticate(self): # Attempt to load token from cache accounts = self.app.get_accounts() if accounts: logging.info("Account(s) found in cache, attempting silent login.") self.token = self.app.acquire_token_silent("User.Read", account=accounts[0]) if not self.token: vs.AlrtDialog('attempt interactive') logging.info("No token in cache or token expired, logging in interactively.") self.token = self.app.acquire_token_interactive(scopes="User.Read") if "access_token" in self.token: logging.info("Authentication successful.") else: logging.error(f"Authentication failed: {self.token.get('error_description')}") raise Exception("Authentication failed.")
-
You could consider maybe making a copy of the VWX bump and ungroup it in to primitive geometry (the plugin will always export primitive geometry regardless of any of the settings in it's interface). You can then just align the SV bump over that one. Or just draw a small cube extrude at the top-front point of the bump and align the top-front of the SV bump with that. Or add a 3D loci to the top-front of the bump, take the coords and then just enter those coords in SV, as from memory that's the point SV uses for loudspeaker hang coords.
-
-
@Nikolay Zhelyazkov easily reproducible with the standard snap grid. I also don't understand why it wouldn't be 0.5x. rounding issue.vwx
-
Two points: Make a template file set up with everything you could need. Our standard template has probably 20 layers in for 10ish trusses, cable bridges, several LED video layers, lighting floor package, PA etc, plus utility layers to contain venue overlays, datums and other boring stuff. All of our standard viewports have the right visibilities turned on ready - so our rigging plot sheet layer has venue, truss and hoists visible and fixtures hidden. Get in to the auto-classing options in Spotlight Preferences. We have it auto-class truss, fixtures and rigging loads automatically, so we generally don't need to create classes much unless something weird comes up. If you're wanting to get more in to efficiency and automation, have a look at scripting with Python. (I say Python rather than Vectorscript as there is so much more learning resource for it on the internet, and it's great). It seems complicated to people that haven't coded before (it did to me last year when I started) but now I've written a ton of business-specific plugins that do exactly what I want. I have ones that can automatically change class and layer visibility for a new viewport in a few clicks, based on our specific content and classing structure. You need to have a really solid standard class and layer structure first for it to be worth it though. Some people say that it shouldn't get to needing scripting, but our industry has as many opinions as there are people that work in it, and rather than the software having 'one' way of working, it's nice that if you really want to make it work your way, you can.
-
I suspect you're trying to pull data from both schematic devices and panel connector objects, which won't work. Database rows work on the basis of reporting a given item, and data about that item. You can't pull data about two items in to a single row. Can you post a screenshot of the database builder dialog? i.e. right click the '2' on the left hand side and edit it. I think there might be a way to do what you're trying to do by reporting on the Panel Connector rather than Device, because I think there are some eval functions for Panel Connectors to lookup associated device information. If you can upload the screenshot I'll take a look.
-
Should be relatively possible with scripting, but I'm not aware of anything built in. Would also be applicable to POE power.
- 1 reply
-
- 2
-
Sure, attached SimonSimonsCablePath.vwx
-
Thanks Pat, no joy with that though. I can return the number of vertices reliably but that call still just returns placeholder values. However, I managed to achieve what I needed by using vs.Get3DInfo to get the Z height of the whole path. That'll do for my needs. Would still be interesting to know what is inside a Cable Path though and how to access the point data. Ungrouping the PIO produces a generic solid that appears to be an extrude-along-path sort of thing.