Jump to content

DomC

Member
  • Posts

    676
  • Joined

  • Last visited

Everything posted by DomC

  1. DomC

    Land XML

    Hello Jussi Thank you for feedback: 1. File Chooser Dialoge. This is a clear fault in the script, this is an error the mask for vs.GetFileN should be something like ("","","xml;txt;csv") 2. flipped x,y, coordinates. I see. The script takes a point like: <P id="1">2748880.61135 1257014.46481 673.96044</P> Where the first value represents the x coordinates. But you are right, some system are based on y coords first. In my opinion from what i remember (in our country) always the bigger value is the x value. Is this also the same in other countries? Then the script could deside from the first line, which number is x value and which is y value. Or the other thing what could be done is, to create a custom dialoge which allows to set coord order. 3. Generally very important. From what i can see in the import Dialoge, your model would be 6'000'000 - 25'000'000 shifted away from the Vectorworks origin. Which produce a big issue in every cad application. Thats why the script recommends shifting the user origin and center the model on Vectorworks Origin (points keep coords but model is centered near the drawing center (Vectorworks internal origin). I would hardly recommend to refer the geo-origin before the import or minimum correct this issue after import.
  2. Hello Maybe you can take a look at this scripts here? I do not know much about LandXML and have not access to example files. Regards
  3. DomC

    Land XML

    Hi I do not know a lot about landXML and where it is used or what exactly are the specification. Or if there different formats with the same designation. However there were some support-requests about this format where manually creating the file with excel etc. is more work than creating a script. Export: 1. Select Site Modell PIO or a Group where a 3D Mesh is included >> Export als LandXML Import: 2. Select a LandXML and import. If the coords are more than 5000km displaced from internal Origin an additional dialoge Pops Up which request to move user origin and center the imported Modell Potential Issues: - Layer Elevation not 0 - Moved/rotated SiteModell PIO - Units not meter (In XML or in VW) - not handle of corrupt PolygonVertex (by export maybe creating 0,0 or 0e100 coordinates if polyVertexReading fails) Script is practically untested just with one file and not tested with other software. Maybe someone can help here to verify it the system is usable. Import of an external created LandXML so far worked and importing the VW Exportes LandXML also worked. Or maybe somebody could attache example here. LandXML.mp4 ImportExportLandXML.vwx ImportExportLandXML v2025.vwx
  4. I also have this experience. I reported this Bug a while ago. Also what could be an issue (as i remember) if you import more than one PIO at once manually and one of them creates an error. then the other PIOs may be corrupted.
  5. Hi, I’m not sure I understand correctly what you’re trying to do. But maybe you just want to name the button-node inside your wrapper and then you see the button appears on the wrapper or the PIO Object?
  6. FYI There is a new example available which allows drawing top plan view of the stair and create the 3D stair out of it. So practically no limit about flexibility. The Marionette just takes the
  7. If i do not find documentation for menu command, i search log or workspace and try this strings and i think last 3 times that worked. Also with Terrain Modell it seems to work. log: {"ts":"01/21/2026 19:13:11 676.266546 +0000","log_lvl":5,"sn":"EMXNWN-XXXXXX-XXXXXX-Z00884","session":"019be1ef4cd7","vw_ver":"31.3.0(846827)","platform":"MAC","os_ver":"15.7.3","cat":"Menu","message":"Menu: 'DTM6 Menu' - 'Site Model from Source Data...' (42) (1)","type":"INFO"} workspace: <UniversalName>DTM6_x20Menu</UniversalName> <MenuItems> <ChunkItem>Site Model from Source Data...</ChunkItem> <ChunkItem>Site Model from Boundary...</ChunkItem> <ChunkItem>Simplify 3D Polygons...</ChunkItem> <ChunkItem>Validate 3D Data</ChunkItem> And this works here. If there are chunk menu index seems to start with 1. If single menu entry index start 0 vs.DoMenuTextByName('DTM6 Menu',1)
  8. Hi Do not remember, what i wanted wanted to do. What maybe can help to know, which layerElevations are attached to a layer and then vs.GetStoryOfLayer(layer). So we can check which layerElevations are used in a story. storyH = vs.GetStoryOfLayer(vs.ActLayer()) if not storyH: vs.AlrtDialog("Aktiver Layer gehört zu keiner Story.") used_story_layers = [] num = vs.GetNumLayerLevelTypes() for i in range(1, num+1): lt = vs.GetLevelTypeName(i) # LevelType-Name (Label) layH = vs.GetLayerForStory(storyH, lt) # Layer für diesen LevelType in diesem Story (oder NIL) if layH: # nur dann ist es wirklich ein Story-Layer in diesem Story used_story_layers.append([lt,vs.GetLName(layH),vs.GetLevelElevation(storyH, lt)]) message_string = f"Story: {vs.GetName(storyH)}\n" for item in used_story_layers: message_string += str(item) vs.AlrtDialog(message_string) Ah i remember, i wanted to create a marionette, which shows a native graphic preview (real dimensions etc.) of the story structure. Still a nice idea .. 😁
  9. Hi After directly accessing the profile of an extrude (Type 24) it seems, that bbox and generally object size and visible wireframe and snapping geometry is shown and stored wrong. As far the best workaround i found for triggering a full "Reset" of the extrude is scaling it by 1,1,1. It there a proper way to reach this purpose? I tried things like: ResetObject, resetBBox setObjectVariable 1167 True. EditProfile.vwx
  10. Maybe you can try the svg-nest marionette: The good think is, you can keept your original geometry in vectorworks after the process. Do not need to export/import
  11. Yes this is what i do. Create views with same predefined names as in publish set. Export the set and then purge them. feels ugly but it is no a first-time feeling 😂
  12. Hi I am not sure, but based on what I know — and what also happens with my installer for the “Sewer” plug-in — the situation looks like this: 1. On macOS, the workspace located in the application folder is modified, and the tool gets integrated into this workspace. In my opinion, this is technically problematic, because nothing inside the program folder should be changed. However, the result if "this maybe-bug" is, that the installer integrates the tool successfully, and it works. 2. On Windows, this does not happen. The workspace in the application folder remains untouched — which is technically good — but on the negative side, the tool does not appear in the workspace because it is never integrated. 3. If a workspace exists in the user folder, then it also works on Windows. In that case, the tool is integrated into the user workspace. 4. One possible solution might be to duplicate the existing workspace into the user folder and then run the “Edit Workspace” procedure. However, I have not tested this yet.I am worried that it might not work, or that detecting the active workspace and switching to the newly duplicated workspace might be non-trivial or even impossible. But you can test it fast. Duplicate workspace on windows. Switch back to Application-Folder-Workspace. Run installer, then switch back to user-Workspace and look if it was installed. I hope it works. Anyway you would have to switch workspace it it looks "automatically installed" for users. Alternatively an AlrtDialog to request users switching/duplicating workspace could be another workaround.
  13. You could open both virtual poly where it starts. While the original scrip calculates and is not geometry related
  14. Looked a little deeper. A pragmatic solution could be, we have a virtual outer and inner contour. which have a regular shape. Then we create the points on this contours: Connecting to the existing script will modell the stair and intersect the shape: One point left, it does not stop by the final contour if it is infinite like this: To use this in a PIO you have to make control-geometry a group and order the elements in the right order: Extract them in the right order important keep order. Otherwise you will mess it up. I took order here in this example 1. VirtualShapeOut 2. VirtualShapeIn 3. Final Form. Then wrap and convert to pio You have to bound the shape ad the escape step. What is missing is the 2D Geometry, which has to many lines now. But it is makable. Not worth to go further if it is not clear if anyway the geometry methode is fitting the requirements. Connect to local Distributor ComputerWorks. They can help. If it takes longer it will be not costless. But maybe this start would help you. Oval Individual Focus points.vwx
  15. Hi First you should think about a rule which is available. Mostly this is the bigger issue than making the some code is thinking how about you think by designing and how to convert it to an algorithm. 1. The rule could be, every step line is "designed" by human (user) - Then maybe the control geometry could contain just inner and outer countur and lines which are created by user and the script would model the 3D stari 2. A logic adaptable rule as example. On the inner countur we need 15cm minimum measurement. this gives us an amount of steps we could use maximum and the vector of the step-line it through this inner minumum point and the walking line of the stair. Problem could be, that every inner distance is the same on the contour and if the countour is not symmetric the steps are not symmetric. But in your case the Stair "eye" is symmetric so this could work. Yes could work. + Symmetrical - But because the out contour and the inner contour have not the same shape as the walking line it is maybe not the best solution. + Walking line could be parallel to outer contour to make the walking path more ergonomic + Relative easy to script. repacing the center through the point which are paired to the other point. 3. The inner virtual center could be defined independent on a contour (similar to the original example but not a center just unique points but not on the contour) + This would result in nice flow of the stair because of similar shampe outer and inner center points - Different distances on the real contour. + Usefull if inner contour is not symmetric. as example Picture one - Looks line best Solution but harder to script. We need points on the outer and virtual contour (easy). Then we need sectionpoints between polyline final inner contour. This is harder. I do not know the good solution for this. Maybe through intersecting line with inner shape etc. Or have you another requirement which could be defined? If i look at your specific stair the rule is like Solution A. Individual drawn steps in 2D. I can not see a rule for calculating the inner points? Generally i think, a stair is one of the last design-peaces an architect can be creative. So maybe it is the right thing to just model individually it take too long to make an algorithm for it.
  16. Hi I searched the Forum but had no luck. So sorry if i ask again what maybe have been asked in past. I have several 3D Cabinet Elements which i want to export as single DWGs each. Automatically without user-interaction. So far, what i figured out and what works well is the following steps: 1. Creating several "unique name placeholder saved view names" by script. By example 200 peaces. 2. Saving a publishing sets which contains all of those views as a DWG Export. 3. Delete the saved views. The Publishing sets keeps stored on the document. 4. Later in the Export routine, save view, which just shows the element i want in a single DWG (hide other object) 5. Doing this for all Objects i have and create a saved view with the same name as the placeholder views. 6. Publish the set. It will export all saved views that exists in real from the saved sets. 7. purging the saved views. Works fantastic and i am glad that i found a solution at all. But: I do not like it, because i have to litter the template file with the "dummy-saved-views". and the export is addicted to the right template file. I need the objects on that specific template with the set. Or i have to create the set manually and then use it. So the question is. Is there a way to write the publish-set by Script? Also it would be useful generally to be able to transport things like this from one document to another one.
  17. Thanks for reply I know a command for getting the cutPlane of the Design-Layer: def vs.GetLayerCutPlane(layer):    return REAL The Walls in 2026 have got a new option to individually set the cut plane of a single wall. Here we can switch from design layer cut plane to cut Plane per Wall. End-Target would be to finde 0-height walls with a worksheet script. It would show, wich walls have 0 height and/or cutplane is 0. Also it would be a good option, to change cutplane from 0-height (wich is default but make no sense) to 0.5mm (middle of a 0-height wall which has always 1mm minimum height). Projects are quite big and it is hard to see what changed and it will be a lot of work to search all walls in every symbol in every annotation inside every group and layers. So it would be the target to search walls with 0-height and set cutplane to 0.5mm which would make them visible again. I think the possible workflow could be to search layer cutplane and change from 0 to 0.5mm. Unfortunately it is not clear what happens with walls inside symbols or annotations. There the script should deactivate the checkbox and then set the cutplane. Problem is just giving 0-height walls a height would not be enough, because cut-plane of zero would not generate a wall section if the wall bottom bound at zero. End Result would be a "Wall Heal Helper Worksheet" and some scripts to fix legacy symbols and wall settings.
  18. Hi Has anyone already found the selector (object variable) or command to access the Wall Cut Plan Options?
  19. Hi I am working on an automated process to create and maintain kitchen cabinets. I already have the basic data, which includes around 10,000 items, some of which are surcharges or variants. All of them need to be included, and the system with the Cabinets PlugIn catalogs seems very well suited for this purpose. Creating the catalog data works, and in combination with the XML (IDM) you can make a variety of useful settings. The filter dialog is dynamically linked to the XML, which is of course very flexible. The goal now is to have about 350 base variants visible as styles, while the rest (variants, etc.) would be accessible through the catalog. So far, everything can be automated – except for creating the styles. What I am missing is the following knowledge: Where is the front layout stored? There doesn’t seem to be a data field for it. From the catalog, the front layout can be loaded (not linked), but it doesn’t seem possible to load the catalog entry via script – only through the dialog window. Likewise, I cannot link the style to the catalog without a dialog window. But dialog windows are of course the end of any automation attempt. At least the workflow with the catalog is theoretically possible: create a single PIO and link it to the catalog. However, I still see the problem that I would like to replace, for example, all cabinets in the Projects through another catalog or variants with cabinets from another catalog entry – and for that, the script would need to be able to directly assign the catalog entry data. I know there are records with data. I can see nearly everything of the cabinet PIO record but exactly not the front information which would be most useful. Also i looked at invisible fields and records. So the information must be stored somewhere hidden. Has anyone had experience with this issue or a useful tip? Would be great. Screenshot (Blurred text and some cabinets. Reason of discretion ) shows, how it looks like if i create the library with extrudes. also possible but not what i like to have at the end. I want to have cabinet PIOs.
  20. Hi I found something which would creates the path independent from VW Version and works with the recommended vs.GetVWRString(res_path, '1') method. Files without extensions: res_path = os.path.join(exe_path, "Vectorworks", "Strings", "210 Folder") and the exe_path with vs.GetFolderPath(1) certainly on Windows. On May i have to use the os.sys because someone could rename the application. Edit: Best solution so far. One single line cross-platform: mep_folder = vs.GetVWRString("Vectorworks/Strings/210 Folder.vwstrings", 297)
  21. I see different ways to get a resource string. I am uncertain if i should use vs.GetResourceString('210 Folder', '1') or "vs.GetVWRString(res_path, '1')" Because GetResourceString has not much entries here in the forum and on github there is written somewhere " GetVWRString replaces GetResourceString" https://github.com/Vectorworks/developer-scripting/blob/main/Function Reference/Functions/GetVWRString.md And "depricated since 215" I think this could maybe be in context if the res_file changes from Vectorworks.vwr to someting else where the resource file path would have to be changed with SetVSResourceFile https://github.com/Vectorworks/developer-scripting/blob/main/Function Reference/Functions/GetResourceString.md What i want to reach is, getting the localised string of the Workspace Folder as example. Or the Localised Folder Name of MEP Tools. If i would use GetVWRString i had to tinker the path and dive into the zipped res folder on windows. Where GetResourceString seems to refer directly to a cached list of Vectorworks string resources. import os import sys import vs exe_path = os.path.dirname(sys.executable) (major, minor, maintenance, platform) = vs.GetVersion() if sys.platform == "darwin": # macOS res_path = os.path.join(exe_path, "..", "Resources", "Vectorworks.vwr", "Strings", "210 Folder.vwstrings") else: # Windows res_path = os.path.join(exe_path, "Vectorworks.vwr", "Strings", "210 Folder.vwstrings") res_path = os.path.normpath(res_path) # Test with localised workspace folder name # works cross-platform without path but # maybe issue, if resource file changes result_GetResourceString = vs.GetResourceString('210 Folder', '1') result_GetVWRString = vs.GetVWRString(res_path, '1') # Ausgabe mit f-String vs.AlrtDialog( f"Exe path: {exe_path}\n" f"VW Version: {major}.{minor}.{maintenance} (Platform: {platform})\n" f"Resource path: {res_path}\n" f"GetResourceString: {result_GetResourceString}\n" f"GetVWRString: {result_GetVWRString}" )
  22. Hi Very useful, thanks for. Maybe it is possible the add Localised Names to the output for a next version? Many users have Localised strings and see nowhere the universal name in the UI. Attached my modified Node for the Localised String Print Parametric Record LocalisedNames v2025.vwx
  23. 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.
  24. 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.
×
×
  • Create New...