Search the Community
Showing results for tags 'pyhthon'.
-
Hello, we are trying to find a way with Pythenscript to Refrence VW-Worksheets a bit flexibel. We are having different Worksheets. We want to Refence one Worksheet with another Worksheet and trying to find out a way that Worksheetname for Reference can be flexible. At the moment with VW-Ref Function, the Worksheetname ist fixed and needs tobe changed if the Worksheetname has been updated. We also try to Run Python-Script in Vectorworks but not able to find out a way, how to retrive a PS result in a Worksheet. We are using this Function: =DATENBANKDURCHSCRIPT(120; 'Landschaft/Script.py') but unfortunately can not see what ist the output. We tried to find a Solution to List all our current Worksheet in some kind of Meta-Worksheet. The Python Script should iterate these objects and we would like to process the results within the RunScript Worksheet-Function but without success so far 😐: def list_all_tables(): # Eine leere Liste, um die Handles aller gefundenen Tabellen zu speichern table_handles = [] # Erste Objekt im Dokument h = vs.FActLayer() # Durch alle Objekte im Dokument iterieren while h != vs.Handle(0): # Überprüfen, ob das aktuelle Objekt eine Tabelle (Worksheet) ist if vs.GetTypeN(h) == 47: # 47 ist der Objekttyp für Worksheets in Vectorworks # Das Handle der Tabelle zur Liste hinzufügen table_handles.append(h) # Zum nächsten Objekt übergehen h = vs.NextObj(h) # Alle gefundenen Tabellenhandles an die Tabellenschnittstelle übergeben for id, h in enumerate(table_handles, start=1): vs.WSScript_AddHandleId(h, id) # Die Funktion aufrufen, um alle Tabellen aufzulisten list_all_tables() We would be very grateful for any tips or information 😃
-
Greetings all, Functions mentioned in title [vs.GetProjectUserNames(), vs.GetResourceTags()] return NoneTypes, not sure whether this is broken. From the DevWiki: http://developer.vectorworks.net/index.php/VS:GetProjectUserNames Description : Get a list of userids that are part of the current project. def vs.GetProjectUserNames(): return (BOOLEAN, userArray) userArray | ARRAY : Array of userids as strings However, upon running this in a Project File, I get a Boolean of True, but a NoneType for userArray. Not sure how to iterate through list of results. This is the same with vs.GetResourceTags(): From the DevWiki: Description : Gets the tags attached to the specified resource. def vs.GetResourceTags(handle): return tags tags | ARRAY : Array of tags Running this on Symbol Definition handle, with tags attached yields a NoneType as well. The Symbol Definition has got tag(s), and running vs.GetNumResourceTags(some_handle) returns the correct number of tags attached to this resource. Any insight would help, @orso b. schmid/ @Pat Stanford