Jump to content

Jayme McColgan

Member
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Jayme McColgan

  1. TLDR: i looking for a way to use vs.SetRField() on a selected PIO (in this case a stage deck) and have it refresh itself before continuing the script. i'm working on a plugin that takes objects, converts them to 3dpolys, and bounces out their points to a file. I'm trying to cut down on the amount of points by simplifying the objects as much as possible before converting... lets say i have a "Stage Deck" object and i want to change its "Structure" field from "Legs-Basic" to "Simple" which really cuts down on its poly count. but when i try to use vs.SetRField() to change that field it doesn't seem to refresh the geometry... after the script runs you can see that the field was changed but the geometry is still the same. i've tried the slu of resets and refresh commands and none of them seem to be helping. ive also tried changing the settings and then duplicating the object with vs.Duplicate() but vs.LNewObj() doesn't seem to be working with that.
  2. @Phsion here are the commands i was talking about: vs.LDevice_ResetVisual() vs.LDevice_Reset()
  3. I'm not in front of my computer to test but I often have to use the vs.refreshlightingdevice() command (I think that’s the name) when working with lighting devices.
  4. using vs.CreateSymbolDisplayControl() and vs.UpdateSymbolDisplayControl() was giving me some unpredictable results when making 2D symbols so i ended up using vs.CreateImageControl2() and vs.UpdateImageControl3() and ended up making my 2d layouts with external libraries. getting much more predictable results!
  5. a few issues things i encountered... i encountered these in both VW2020 and VW2022 - i think vs.BuildResourceList() is broken... the code below (which is just a portion of the whole script) return the correct num_list but the symfold_list wouldn't have a handles in it. i could also be using it wrong... path = vs.GetFolderPath(23) + "MIG Symbols.vwx" symfold_list, num_list = vs.BuildResourceListN(92, path) - i tried building a list using type 121 (Lighting Instrument - Symbols) but it always returned nothing.
  6. here my version, might be able to be cleaned up some but it works for me. import vs ### init List of all lights all_lights = [] ### init List of lights to ignore cur_lights = ["Viper", "Leko Body", "ETC Source 4 Body"] ### 121 = Lighting Devices ### 92 = Symbol Folders ### Loop though everything in a current symbol folder def start1(cur_handle): first_sym = vs.FInSymDef(cur_handle) for i in range(20): if first_sym.type == 16: add_Symbol(first_sym) first_sym = vs.NextSymDef(first_sym) ### Add lighting device to list def add_Symbol(current): hasRecord = vs.Eval(current,("R IN ['Light Info Record']")) if hasRecord: if vs.GetName(current) not in cur_lights: all_lights.append(vs.GetName(current)) cur_lights.append(vs.GetName(current)) return None ### main loop def start(): #path = vs.GetFolderPath(23) + "MIG Symbols.vwx" #symfold_list, num_list = vs.BuildResourceListN(92, path) symfold_list, num_list = vs.BuildResourceList(92, 0, "") vs.AlrtDialog(str(num_list)) for i in range(num_list): cur_handle = vs.GetResourceFromList(symfold_list, i) start1(cur_handle) vs.AlrtDialog(str(all_lights)) return None
  7. yeah i got that. ideally i want to go though everything in the resource browser. I'm starting to make some head room with vs.FSymDef() and others that go along with it. i understand i will have to deal with each type of symdef and loop though folders within folders as they pop up to get symbols within. ill pick this back up tomorrow. going to sleep
  8. so heres a slightly different question... how do i loop through all symbols in the resource browser and build a list if a symbol has a certain record attached to it. in this case i need to build a choice list for a dropdown in a dialog box.= based off symbols that have a specific record attached to it.
  9. can't really seem to figure out how to do that for the items that live in the resource browser. I'm not trying to work on symbols that are placed in my drawing...
  10. hey y'all, i need to go though a bunch of symbols and attach a record and fill out the fields and I'm trying to automate that... ive got a way to do it for symbols i have inserted into a drawing but i need to find a way to do it to the symbols that live in the resource browser. is there a way to attach or update a record for a symbol in the resource browser? EDIT: i kinda shifted directions half way though this... this topic is really about how to return all the lighting devices in the resource browser.
  11. man... if it had teeth it would of jumped up and bit me.... how did i miss that. 🤦‍♀️
  12. hey guys, working on a plugin that replaces various objects with solids so i can send them to another program. I'm running into an issue with mirrored objects. when i create my solid and then rotate it into place using vs.RotatePoint() the object goes the wrong way because its mirrored. is there a way to undo mirroring or to know if an objet has been mirrored so i can deal with it per object.
  13. Hmmm that's in intresting one. I have a workflow for importing symbols bit I haven't done it though workgroups. I've never actually used workgroups. Let me do some testing today and I'll get back to you.
  14. @MullinRJ is it possible to create a window to display some 2D shapes that could be updated based on values in the rest of the dialog box? trying to display a visual representation based on the values of the fields in dialog.
  15. Here is a sample for those looking at this later on in life.... import vs from datetime import datetime def Dialog_Handler(item , data): time = str(datetime.now().strftime("%m/%d/%Y %I:%M:%S %p")).replace(" ", "") ### Get current time and removes spaces wallname = vs.GetItemText(dialog1, 25) ### Get the value of the text field you are updating vs.SetItemText(dialog1, 23, f"{vs.GetFName()}_{wallname}_{time}.png") ### Pushes the new data to a field of your choice
  16. that my friend is exactly what i was looking for! thank you!
  17. i have narrowed it down to my Serial Number checker that i include in some of my more complex plugins... it was using urllib to reach out to a server, I'm assuming something with that was causing the issue. i have since moved to the request library and just include the module in a "python externals" folder in the user plugin. all better now!
  18. so i spent some time today building dialog boxes to learn how they work and I'm actually having some fun with it. is it possible to update other fields based on a vs.CreateEditText() field? id like to be able to type something in there and then it update a static text field somewhere else in the dialog box. preferably in real time... i see theres a vs.NotifyPullDownClicked(), which means theres some sort of functionality like that already. also is there a way to set a statictext field ALL THE WAY to the right side of the dialog box? basically above the OK button.
  19. I'm sure this error is super generic but I'm not sure whatelse to include.
  20. hey yall, so I'm getting VW2022 up and running and migrating my plugins over. i have one plugin thats giving me an error. Traceback (most recent call last): File "<string>", line 1 in <module> ValueErroe: bad marshal data (unknown type code) now the weird thing is i only get this error after encrypting it... it works great before encrypting it.
  21. very cool! how would you go about changing the Sheet layer settings like the Page setup and size
  22. most of our files will start on a mac then i would send the file to a windows computer that sits in our server room to do the rendering. I'm going to give the suggestion that @herbieherb suggested and see how that goes.
  23. hey guys, i want to explore an idea and want to see if anyone has done something like this. i sometimes need a way to update all viewports locally on another computer so i don't lock up my computer, which consists of me opening my VW file on another (super beefy) computer and rendering all viewports from there. thats all fine and dandy but I'm trying to automate that so when its done it would save and close the file and let me know its done. i know VSS has this feature but i need to be able to do it locally sometimes. questions i have: - is it possible for a plugin to open a VW file on a remote computer and tell it to "Update All Viewports"? - how do you know when the "Update all viewports" process is done? (i didn't really see anything in the VS references for it) - Could i have VW launch a script when its opened? (i could have a computer open files from a watch folder via an external python script but idk how to have VW start the update process once the file is open.)
  24. interesting... i will give this a shot. thanks!
×
×
  • Create New...