Jump to content

twk

Member
  • Posts

    877
  • Joined

  • Last visited

Everything posted by twk

  1. 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.
  2. Yep have filed a bug (VB-196628), but it wasn't just my workspace. Even with the stock workspaces, once you edit the stock workspace and nest any of those tools (doesnt have to be all of them) it will cause the crash when exiting the Edit contours mode. I'll try and find time for a demo video illustrating.
  3. Well well well.. just spent the last 3 hours diagnosing what was happening and causing the crash. Turns out it wasn't: - a converted workspace - custom short cut keys for my workspace - or any custom plugins I had The Trial and Errors Before I unveil the culprit and the solution, share in my grief that which I painstakingly tried. (Side note, there were other anomalies found that were causing other crashes) : 1. Converted multiple stock workspaces (ANZ, ANZ-BIM) 2. Removed all shortcut keys 3. Editing Tools and Menu Items to add our set of custom office shortcut keys 4. Re-organised icon positioning and stacking within palettes to match our previous office workspace setouts. Test actions to trigger the crash 1. Editing or just entering the contours space, for the -> Grade Limit Site Modifier's 'Define by Contours' 2. Upon exiting, Vectorworks crashes SiteModelEdit_Crash.mp4 The culprit(s): - Stacking Tools used in this mode (Reshape, Split, Trim, Clip, Pan, Zoom, and others). 1. If these tools are stacked in my workspace it will cause the crash. They must be at the top most level in the tool palette 2. When you're in this contour edit mode of the Grade Limits site modifier, you can see that these tools are not stacked beneath anything The solution: After all that testing, all I had to do was make sure that my custom workspace had these particular tools 'unstacked'. Ie not nested under another tool. If anyone has a spare moment can you test this by in your own workspace, nest one of these tools (any in my experience) and see if it crashes. @Matt Panzer, @Vlado, it looks like the Contour Edit Palette above is causing some issues, I shall file a bug.
  4. Apologies looks like there was an extra line after the 'while' call. correct below: # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(excluded_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if excluded_layer_names: if layer_name not in excluded_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names
  5. You know what, I misunderstood your question. You're wanting an excluded list. We'll revise the 'list_sheet_layer_names' function that accepts a list of sheets to be 'excluded' as a parameter. # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(excluded_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: layer_names.append(hLayer) if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if excluded_layer_names: if layer_name not in excluded_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names then when you run the iteration, you provide the list of sheet names you want excluded: # Iterate through all sheet layers in the current document # Say you want to exclude sheets 01, 05, 10, 12 for layer in list_sheet_layer_names(['01', '05', '10', '12']): # Define criteria strings to find title blocks and viewports on the current layer titleblock_crit_str = f"(((L='{layer}') & (PON='Title Block Border')))" viewports_crit = f"(((L='{layer}') & (T=VIEWPORT)))" # Use the get_objects_from_criteria() function to get lists of title blocks and viewports on the current layer titleblocks = get_objects_from_criteria(titleblock_crit_str) viewports = get_objects_from_criteria(viewports_crit) <<< RESET OF CODE >>
  6. Good point @Pat Stanford. My workspace is probably converted from 2021 if I can recall correctly. It's strange though, editing the contours and updating the site model works fine if I'm on the Architect workspace, as soon as I change the workspace to my converted one, and then try to edit/update the contours through the grade limit, it crashes. And this is all within the same session. I would've thought the tools or the operations that run in the background are not dependent on anything stored in the workspace. But all good, will re-do a fresh workspace, it is about time.
  7. Reporting back again, that the culprit is my workspace. If I use my custom workspace, it crashes, if I use one of the stock vw workspaces its fine. Off to the bug reporting department.....
  8. Reporting back that a fresh re-install of VW23 seems to have fixed it. Thanks all for testing
  9. there was a mistake in the indent blocking for the last line of the loop, the hLayer = vs.NextLayer(hLayer) shouldn't be nested in the else portion. Fixed below: # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(filter_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: layer_names.append(hLayer) if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if filter_layer_names: if layer_name in filter_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names
  10. revised list_sheet_layer_names below, added option to provide a list of layernames you want to only be returned. # Define a function to list the names of all sheet layers in the current document def list_sheet_layer_names(filter_layer_names=None): """ @type filter_layer_names: exclusive layer names list ie, only these layers to be returned """ layer_names = [] hLayer = vs.FLayer() # Use a while loop and the NextLayer() function to iterate through all the sheet layers in the document while hLayer != None: layer_names.append(hLayer) if vs.GetObjectVariableInt(hLayer, 154) == 2: layer_name = vs.GetLName(hLayer) if filter_layer_names: if layer_name in filter_layer_names: layer_names.append(layer_name) else: layer_names.append(layer_name) hLayer = vs.NextLayer(hLayer) return layer_names
  11. Much appreciated. I think there must be something up with my install. I shall try a fresh reinstall
  12. Can I ask for your confirmation if this has been working for you @jeff prince, @Pat Stanford, @Katarina Ollikainen? Please and thank you
  13. Maybe my post made it sound like I am using chatGPT to write full working code. If so, apologies, that is not what I meant. Your findings, and Pat's is the expected behaviour. chatGPT should NOT be used or trusted to write 'working code'. I think if this is established before embarking on its use, then it will be of better service. "We" still need to know the syntax for the programming language, be it Vectorscript or Python. The 'success' I explain is more so with me finally understanding key concepts of areas of python, vectorscript, marionette python and just general maths and computer science in general. For example I take the wonderfully written vectorscipt code by @_c_ on Listbrowsers at https://developer.vectorworks.net/index.php/User:CBM-c-/Dialog_with_List_Browser I take that vectorscript code, and I ask chatGPT to explain it to me, and portion by portion. What each function does, why its positioned where its, can it be improved, etc. I then take that knowledge and write my own python code, based on the logic explained to me by the LLM. So there's still required knowledge of python and vectorworks, and vectorworks' api calls etc. But now, I have this ready-to-go tutor to help me along the way. And this has saved me countless hours of searching on the internet, and forums. And this goes for Marionette nodes as well, I explained in a previous post about the divide nurbs node in the marionette library. I opened up the node, copied the code, ran it through chatGPT to explain to me why this was done this way, and implemented my own code for doing the same function, but on a polyline or polygon. This knowledge actually led me to now trying to understand vectors, and vectors in maths and computer science etc. Which I am a novice in, I hated maths in high school, and here I am enjoying the learning journey some 15 years later. So, can it achieve things in vectorscipt or python in vectorworks, short answer yes. How? As a learning tool, not a functional script writer.
  14. Has anyone successfully used 'define by contours' for the new grade limits modifier? I have tried in fresh files and old files and vectorworks keeps crashing. Attached example SiteModelGradingTest.vwx
  15. Of course, one of the script-masters, @JBenghiat. I will test the DoMenuTextByName route, will post back findings. Thanks again.
  16. Hey Jesse cool find, two quick questions: 1. How on earth did you find this. I have a run a content search accross the sdk zip file and found nothing regarding the 9743 variable 2. I'm trying to do the reverse of this. If my active view is within a container, in my case the viewport annotation group, I want to exit this container via script. If I use my trick of vs.Layer(<layer i'm wanting to go to>) to set the active layer, my active view remains still in the annotations space. Maybe a bug, but I was wondering whether you knew of any other jedi variables. Cheers.
  17. I select the Import>Script from file option, when I'm doing rapid testing. (I have it setup as a right-click context menu command as well)
  18. Check your shaded options settings: See Quality > Details
  19. AI has been a catchphrase for chatGPT, but really AI is way more broad than only chatGPT. chatGPT is a Large Language Model, at its simplest, it is a text prediction bot on steroids. Its been trained on almost every datapoint on the internet to learn when a person asks one thing in a text prompt, and try and figure out what are they really asking for. Artificial Intelligence has a plethora of subfields> computer vision, natural language processing, machine learning, deep learning, diffusion models and more, and the GPT model is one of them. (*chatGPT is just one GPT model owned by openAI, and now closed-source. There are many open-source models out there trying to compete with openAI) With regards to chatGPT, I have been using it extensivley as a 'co-pilot' in writing python scripts and code (you can search my posts for examples). As it is in itself a type of language, you have to coorece it in certain ways to give you the type of answer you're looking for, but most of the time it does get it right; and the other times, well... funnily-drastically-wrong. The rule is: don't trust it, and always double check what it spits out. But for coding it has been amazing, as it can actually analyse your code in milliseconds, and rewrite it to use better coroutines and code structures. I have also been using it to explain code back to me. The marionette nodes have their codes accesible, and you can copy and paste the code into chatGPT and ask it to explain to you, the code-flow or code logic, to see why the VW engineers did what they did under the hood, and then use that explanation to refine the nodes to do what you want it to do, or even ask it to fine tune or rewrite code more efficiently. As for building codes and regulations, it is also a perfect use case. Another colleague of mine has been using it to interpret legal jargon for building code clauses into easier to understand layman terms. And that is using it for what it was built for. Not for redesiging buildings. But there are offshoots of this particular AI field (GPT), that is more fascinating (look up autoGPT, miniture bots that create tasks for itself to solve, that are actaully aimed at solving a bigger initial task). And these can be used for anything from writing a shopping list from a menu with up-to-date prices to gathering case studies for a legal case. The thing I am most concerned about these technologies and the hype surrounding them is the pace at which this thing is moving. I don't think any of us are ready for whats coming. It will touch every aspect of society. Even those who created, developed and funded these things can't explain why it does some of the things it does, some even going as far as to say to put a haitus on its development. At the end of the day, these technologies and any technology is a tool. A hammer on its own is useless, in the hand of a builder, it can be used to build things, in the hands of a demolition guy, it can be used to destroy things. I don't think it will lead to more mundane buildings/spaces, those who know how to use it will build great things, and those who don't will build not-so-great things.
  20. Found the issue. I develop in the PyCharm IDE. When I'm doing rapid testing, I just run the Import/Run Script Command in Vectorworks and point to the py file. Which effectively runs the python script in Vectorworks. 99% of the time it works, except for these interactive functions I've just found out. However I can still develop in PyCharm, and rapid test, but I need to create a script resource in Vectorworks, and have the script hold the import functions call pointing to that py file/function from here. Then it works. Will submit a ticket
  21. Nope, developer mode is disabled. Are you saying this works for you? Doesn't crash?
  22. This simple script (outside of using plugins) crashes vw. Can someone else confirm? @Vlado, what am I doing wrong here? import vs h = vs.FSActLayer() def callback(pt1, pt2): vs.AlrtDialog(f'pt1: {pt1}, pt2: {pt2}') vs.GetRect(callback)
×
×
  • Create New...