-
Posts
654 -
Joined
-
Last visited
Reputation
656 SpectacularPersonal Information
-
Location
Switzerland
Recent Profile Visitors
36,665 profile views
-
-
Hi I think, it crashes because of the icon_path parameter the following work here. Creating Tools Set in Tools and then add a Tool import vs # Start editing workspace vs.wsEditBegin("View") # Get Basic palette path (index 0) pName = vs.ws2GetToolAt("", 1) vs.AlrtDialog(f"Basic palette name: {pName}") result, outDisplayName, outShortcutKey, outShortcutKeyModifier, outResourceID = vs.ws2GetToolInfo(pName) vs.AlrtDialog(str([result, outDisplayName, outShortcutKey, outShortcutKeyModifier, outResourceID, pName])) tsPath = pName universalName = 'universal_name_f01b8' setName = 'NewSet' vs.AlrtDialog(str([tsPath, universalName, setName])) icon_path = os.path.join(vs.GetFolderPath(1), 'Vectorworks 2025.app', 'Contents', 'mock-texture-overall.png') ok = vs.ws2CreateToolSet(tsPath, universalName, setName, icon_path) vs.AlrtDialog(f"Tool add success: {ok}") toolPath = f"{tsPath}/{universalName}" vs.AlrtDialog(f"tool Path: {toolPath}") # Add tool to Basic palette ok = vs.ws2CreateTool(toolPath, "Blindfold", 2) vs.AlrtDialog(f"Tool add success: {ok}") vs.wsEditEnd(False) # Save and end session vs.ws2CommitChanges(False, True) Edit: It seems, that if ToolSet is not exists it needs an icon path even the icon was not found empty string let it crash. Also None crash. It seems to work with False, aString as the icon_path but not with None or empty string.
-
Hi Not in that matter right now. Minimum i can confirm it crashes 😁 missing icon path or missing wsEditBegin or wsEditEnd. The above Test worked in 2022 and 2023. Maybe there was changed something in the meantime.
-
How can I reference my Marionette Object in a worksheet?
DomC replied to Dmoozak's topic in Marionette
Hello Sorry for digging up this old thread. For those who, like me, didn’t know yet: there is a Function option in the worksheet. ObjectData('parameter', 'YourParameterName') I tested it—and it works! It is even bidirectionally linked to the Marionette parameter. -
After a brief search in the forum, I couldn’t find any information on this topic. When using Data Mapping in the Data Manager, we can set the option “By Mapping” for Vectorworks Records using the function: vs.SetRFieldOpt(h, record, field, isEmpty, isDataLinked) This results in the arrow icon appearing in the Object Info Palette, indicating that the field is linked to the Data Manager mapping. Is there a similar command available for custom IFC Property Sets (ifcPsets)? That would be extremely helpful. Our general recommendation is to maintain an internal office data structure using a standard user-defined Record Format (the default Vectorworks Record Format). The custom ifcPsets are typically project-specific additions, and we map the values from the VW Record into the ifcPsets. It would be great to have the ability to switch all fields that are mapped in the Data Manager to the “By Mapping” option in bulk. Custom (manually entered) values should remain untouched. This process works for records using a script, but I haven’t found a solution for custom ifcPsets yet.
- 1 reply
-
- 1
-
-
Hi Try with vs.ReDrawAll() inside your breaks. At the end the workflow could be exporting images and combine to a movie to make visible your script. Like here i dumped the results in graphics and combined after to a movie: But I would say, it could work. With some luck and vs.ReDrawAll() in the code. Look attached File (Sound is deactivated but animation is visible, imagine the holy night christmas song ...). Also as example this script would show an animated rectangle: Animation.mp4 The christmas animation directly in Vectorworks https://youtu.be/MexEualOq7g And this one with exported graphic and merged together to a movie: https://youtu.be/V_-apzxOTXM For Samichlaus2 v2025.vwx
-
Hi Sam I would get the distance between the two points. Than draw a 2D Dimension and place with SetEntityMatrix. But i just used it for orthogonal 3 Dimension not "free rotated in space" #then to make it 3D vs.SetPlanarRef(inObj, refID) # then to place in 3d space _bool = b = vs.SetEntityMatrix(inObj, offset, rotAng[0], rotAng[1], rotAng[2]) # if your points are orthogonal it was easy. If not you need the euler angles and so you need 3 points to calculate. snipped how i use it: def create_dimension_by_direction(p, l, dim_type, angle, direction = (0, 0, 0), dim_off = 150, standard='RS ISO 1x', text_size=3, text_offset = 1): try: if l > 0.1: x_dir, y_dir, z_dir = direction vs.LinearDim((0,0),(l,0), dim_off,dim_type,769,True,0) dim = vs.LNewObj() vs.SetPlanarRef(dim, -1) (dx, dy), parallel_p2 = find_parallel_line_from_angle((p[0], p[1]), angle, l, 30, clockwise=True) _bool = vs.SetEntityMatrix(dim, (dx, dy, p[2]), x_dir, y_dir, z_dir) # vs.SetObjectVariableString(dim, 27, standard) #dim standard vs.SetObjectVariableReal(dim, 40, text_size) #font size vs.SetObjectVariableReal(dim, 43, text_offset) #text offset vs.ResetObject(dim) except: pass return vs.LNewObj() dim = create_dimension_by_direction((p1[0], p1[1], 0), n_height, 4, b, dim_off = -300, direction = (b-90,-90, 180)) #text under the dimension line vs.SetObjectVariableString(dim, 1233, f"{s_group}-{short_uid}-{arg_dict['index'] + start_index}-Höhe")
- 1 reply
-
- 1
-
-
Placing all symbols from the recourse browser on a Design Layer
DomC replied to Bas Vellekoop's topic in Marionette
Hi You may search for this one? -
Ramat Bernard started following DomC
-
Solvable this way: vs.DSelectAll() for item in vp_list: vp_handle, l, i, vertex_angle = item vs.SetObjectVariableBoolean(vp_handle, 1004, True) #set vp out of date vs.SetSelect(vp_handle) #vs.UpdateVP(vp_handle) this does not do the job # not beauty, but it works vs.DoMenuTextByName("Updated Selected Viewports", 0) vs.Wait(1) vs.DoMenuTextByName("Updated Selected Viewports", 0)
-
I try to get the right selector for that menu Command vs.DoMenuTextByName('Update Selected Viewport', 0) Background is, that i fail with vs.UpdateVP() when i want to have hidden line render it somehow shows elements from hidden class. if i update viewport by menu it looks all right after that. I pasted some code but it is try and error code. In Main i 1. hide all classes 2. hide classes which are mandatory for object size 3. UpdateVP to measure size of the minimal vp crop size 4. show rest of classes i want to see 5. Update vp again I am sure, somewhere i had to reset a cache, an object variable etc. It works with Shaded View but not with hidden line. I just need a pragmatic solution so DoMenuTextByName whould do the job. code vp_handle = vs.CreateVP(layout_handle) set_vp_scale(vp_handle, scale) hide_classes_by_keword(vp_handle, 'RS_Mobiliar') #vs.UpdateVP(vp_handle) hide_classes_by_keword(vp_handle, 'RS_Wand-') ##_bool = vs.SetVPClassVisibility(vp_handle, 'RS_Mobiliar', -1) #vs.UpdateVP(vp_handle) class_name = 'RS_Wand-' + space_name + '_' + str(i) class_name_last = None class_wall = 'RS_Wand-' + space_name + '_gesamt' if i == len(segment_lengths) - 1: class_name_last = 'RS_Wand-' + space_name + '_' + str( i + 1) #_bool = vs.SetVPClassVisibility(vp_handle, class_name_last, 0) visible_classes = visible_classes_construction_netto + [class_name, class_name_last, class_wall] set_class_visibility(vp_handle, visible_classes, invisible_classes_construction_netto) _bool = vs.SetVPLayerVisibility(vp_handle, space_layer, 0) _bool = vs.SetEntityMatrix(vp_handle, (pos, 0,0), 0, 0, 0) vs.SetViewMatrix(vp_handle, (0,0,0), -90, -vertex_angles[i], 0) vs.SetObjectVariableInt(vp_handle, 1000, 0) vs.SetObjectVariableInt(vp_handle, 1001, 6) #hidden line background 1036 # hier sind Klassen ausgeblendet, die übger den VP hinausschauen. Damit die BBox sauber ist, muss das so aktualisiert werden vs.UpdateVP(vp_handle) vp_cache = vs.GetVPGroup(vp_handle, 3) tl, br = vs.GetBBox(vp_cache) w = br[0] - tl[0] bl = tl[0], br[1] vs.RectangleN(bl[0], bl[1], 1, 0, w, 4000) rect = vs.LNewObj() vs.SetPlanarRef(rect, 0) # Und hier kommen diese Klassen vom Rand wieder dazu. Z_.B. Eckv erbindung guckt ja auch überr die BBox der Wand raus oder Bemassungen _bool = vs.SetVPCropObject(vp_handle, rect) visible_classes = visible_classes_construction_final + [class_wall] set_class_visibility(vp_handle, visible_classes, []) set_vp_class_colors(vp_handle) vs.SetObjectVariableInt(vp_handle, 1001, 0) #wireframe vs.SetObjectVariableInt(vp_handle, 1001, 6) #hidden line #vs.SetObjectVariableInt(vp_handle, 1006, 0) #foreground #vs.SetObjectVariableInt(vp_handle, 1036, 3) #hidden line ovViewportForegroundRenderType 1036 #vs.UpdateVP(vp_handle) #vs.SetObjectVariableInt(vp_handle, 1036, 6) #hidden line ovViewportForegroundRenderType 1036 #vs.ResetObject(vp_handle) vs.SetObjectVariableBoolean(vp_handle, 1167, True) vs.ResetObject(vp_handle) vs.UpdateVP(vp_handle) vs.ReDraw() #vs.HMove(vp_handle, pos, 0) l = w / scale #(segment_lengths[i] + 68) / scale vp_list.append([vp_handle, l, i, vertex_angles[i]]) What it does: Taking the modell After vs.UpdateVP i have the result "Before Update". After Menu Command Update i have result "After Update" I Tried a lot (vs.SetObjectVariableBoolean(vp_handle, 1167, True) etc. ) but seems not the right things ...
-
Clever and elegant. Thanks for that input!
-
OK, i solved like this (maybe still errors but so far is should work like this): A column with the last publishing date: =VERKETTEN(IF('Title Block Issue Data-1'.'Date'<>'', 'Title Block Issue Data-1'.'Date', IF('Title Block Issue Data-2'.'Date'<>'', 'Title Block Issue Data-2'.'Date', IF('Title Block Issue Data-3'.'Date'<>'', 'Title Block Issue Data-3'.'Date', IF('Title Block Issue Data-4'.'Date'<>'', 'Title Block Issue Data-4'.'Date', IF('Title Block Issue Data-5'.'Date'<>'', 'Title Block Issue Data-5'.'Date', '-')))))) And then a column for comparison the last Revision with the publishing date: =IF(TEILSTRING('Title Block Revision Data-1'.'Date', '.', 1)>TEILSTRING(M5, '.', 1), 'neu', IF(TEILSTRING('Title Block Revision Data-1'.'Date', '.', 2)>TEILSTRING(M5, '.', 2), 'neu', IF(TEILSTRING('Title Block Revision Data-1'.'Date', '.', 3)>TEILSTRING(M5, '.', 3), 'neu', 'alt'))) TEILSTRING is same as SUBSTRING
-
Hi Somebody have experience converting the date string into a number? I want to 1. Compare and take the last Date. Which also works like this but is not very elegant: =IF('Title Block Issue Data-1'.'Date'<>'', 'Title Block Issue Data-1'.'Date', IF('Title Block Issue Data-2'.'Date'<>'', 'Title Block Issue Data-2'.'Date', IF('Title Block Issue Data-3'.'Date'<>'', 'Title Block Issue Data-3'.'Date', IF('Title Block Issue Data-4'.'Date'<>'', 'Title Block Issue Data-4'.'Date', IF('Title Block Issue Data-5'.'Date'<>'', 'Title Block Issue Data-5'.'Date', '-'))))) 2. I want to compare revision is newer than approved I could split the date into year, month and day and then compare each to find if one is newer than the other. But maybe there is a direct way to convert a date into a number? i already tried int('Datestring') with different formats m/y/d, d/m/y etc. but that seems to fail Edit: It works with a plain cell with a date string. But not yet with a calculated date.
-
garrettohler started following DomC
-
Robert Fuchs started following DomC
-
-
Hi My idea is to create a web server, host a dialog there, and exchange data via the web directory of the hosted content. So far, I see the following possibilities: 1. **Dump the site from Vectorworks to a local file.** Local web content is restricted and, as far as I can see, cannot contain cross-references or multiple files. This is for security reasons, as a web application shouldn't control the local file system. One way to address this is by using a local development server (e.g., Python's `http.server`) to serve the content over HTTP, bypassing these restrictions. 2. **Launch an Apache server on macOS.** This works so far; the site is hosted in a machine directory that is accessible with root privileges. It's quite simple to do with a `subprocess sudo apachectl start`. This would work, and the web application could load and write data in the directory. However, this requires root access to start Apache. Or having to manipulate configuration files. 3. **Launch a web server via Python.** Here, it’s not possible to launch it directly within Vectorworks because the server would block the Vectorworks main thread, as Python’s default HTTP server runs synchronously. 4. **Launch a Python web server as a subprocess and access the embedded Python in Vectorworks.** This could be possible, but the environment variables in the OS might not handle the embedded Python properly. Explicitly configuring the subprocess environment or using isolated Python installations could help mitigate this issue. However, it's possible that the embedded Python content is designed to run exclusively within Vectorworks, making this option challenging. bash python3 -m http.server 8080 5. **Installing additional application in the OS.** This is also possible, but the solution should work like a portable standalone application rather than requiring content to be installed into the system. Tools like Docker or portable Python distributions could make this approach feasible without impacting the system setup. 6. **Using an external web application to handle everything.** In this approach, you send a token, the web application processes the data (e.g., sanitizes and validates it), builds the site, and writes results to a database. The local script can then retrieve the results using the temporary token. I’ve used this method for some projects, and it seems very flexible and powerful. However, it requires an external web service and isn’t lightweight at all. 7. Creating one single local web-page Merging everything in one file would work for pushing the content into the site. Still the issue then, that it is not possible to write something on the disk, which would work with the #2 apache webservice. I know an SDK-developed application could make direct access possible (anyway i never tried this, too much respect from the c++ environment), even with a non-blocking palette. But still there is the other question of hosting the site on the localhost. Does anyone have additional ideas for a simple, secure and clean workflow to host the web-content?