Jump to content

Jayme McColgan

Member
  • Posts

    196
  • Joined

  • Last visited

Everything posted by Jayme McColgan

  1. I recently ran into an issue where I haven't been accounting for the document units in my PIO... **facepalm** so I'm going back through my plugins and fixing any hard values. I have a plugin that does a lot of drawing using rect and arc... now that's a lot of values I have to convert (currently using vs.ValidNumStr(f'{-6.2}"')[1] format to convert). below is an example of something I need to convert. is the way I'm doing it the best or is there a more easy "global" way of converting for the document units? vs.BeginGroup() vs.RectangleN(-12,-12,0.03,0,24,24) vs.Arc(-8.9,3.0,-2.93,-3,90,360) vs.Arc(2.93,3,8.93,-3,90,360) vs.Arc(4.31,7.34,5.18,6.47,90,360) vs.Arc(6.437,7.34,7.31,6.47,90,360) vs.Arc(8.93,3.849,9.81,2.97,90,360) vs.Arc(8.93,-2.97,9.81,-3.84,90,360) vs.Arc(6.43,-6.47,7.31,-7.34,90,360) vs.Arc(4.31,-6.47,5.18,-7.34,90,360) vs.Arc(-5.18,-6.47,-4.31,-7.34,90,360) vs.Arc(-7.31,-6.47,-6.43,-7.34,90,360) vs.Arc(-9.81,-2.97,-8.93,-3.84,90,360) vs.Arc(-9.81,3.84,-8.93,2.97,90,360) vs.Arc(-7.31,7.34,-6.43,6.47,90,360) vs.Arc(-5.18,7.34,-4.31,6.47,90,360) vs.EndGroup()
  2. hey everyone, so I'm moving from VW22 to VW24. I have a VWX file in which I store a ton of items that I use in all my drawings/plugins. I was testing my plugins and noticed that some that use vs.CopySymbol() were very slow compared to VW22. a normal time in VW22 is 0.04sec and VW24 was 3.3secs. I know that's not horrible but I'm curious why this is happening. The VWX file is ~900MB and I opened the file with VW24 and saved it as a VW24 version. is that the best way to do that? what would be causing the increase in time?
  3. is it possible to make a tool pallet that has text fields and buttons and all that jazz? One of the plugins I'm building talks to external gear and I need to dial in some settings every time before sending commands. I originally thought about using a point object but some of the commands require me to select lighting devices in the CAD before sending so I wouldn't be able to select the lights I need and hit a button in a point object OIP. I guess I could do a menu command and have a dialog box pop up every time before sending but that sounds clunky to me... thoughts?
  4. hmm, interesting. That's not how I've been taught that spanners should work. I guess I have to revisit that. if I wanted to send the spanner 10' above the truss and connect them with a motor or dead hang what's the proper way to do that?
  5. I figured it out... I needed to set the fill pattern to a negative number. vs.SetFPat(h, ledtext * -1)
  6. I'm trying to apply an image to a surface. I got all the code I need except for how to apply the image I just imported... I've tried vs.SetFPat() and vs.SetTextureRefN() with no luck. ### getting handle (h) from eariler in code texture_image = vs.ShowCreateImageDialog() if texture_image != 0: newtex_name = f"QR_CODE_{datetime.datetime.now()}" vs.SetName(texture_image, newtex_name) ledtext = vs.Name2Index(newtex_name) vs.SetObjectVariableLongInt(h, 695, -10) ### vs.whateverapplysanimage() haha vs.SetObjectVariableBoolean(h,79,False) vs.SetObjectVariableReal(h,70,-((vs.HWidth(h)/2)*25.4)) # X pos vs.SetObjectVariableReal(h,71,-((vs.HHeight(h)/2)*25.4)) # Y pos vs.SetObjectVariableReal(h,72,(vs.HWidth(h))*25.4) #width vs.SetObjectVariableReal(h,73, (vs.HHeight(h))*25.4) #height vs.SetObjectVariableReal(h,74,0) #rotate vs.SetObjectVariableBoolean(h,75,False) vs.SetObjectVariableBoolean(h,76,False) vs.SetObjectVariableBoolean(h,77,False) vs.SetObjectVariableBoolean(h,697,False) vs.SetObjectVariableBoolean(h,1160,True)
  7. I'm only here to say It's probably unhealthy the amount I use vs.LNewObj() in my code. Lol Except for when using vs.SymbolToGroup() because that disables vs.LNewObj() for whatever reason. 😒
  8. hey everyone, this is kinda hard for me to explain over text so I'm going to try my best... I'm having an issue where using a spanner truss is returning weight loads that I wouldn't expect it to. here is the configuration... the truss running from the top to the bottom is my spanner truss. in the show, these will be butted up against each other and connected with cheeseboroughs or a spanset. the image below shows if I remove the spanner and put in a "fake motor" (the red box is where the spanner was) it says that the motor is picking up ~656 lbs. When I replace that back with a spanner why in the image above would it push the 2 points just outside of the spanner close to 1000lbs? the image below shows that if I bump the spanner up a few inches to disconnect it from the truss and "insert a drop" I get closer weights to what I expected but the weights on the spanner truss motors seem low... I'm not really sure whats going wrong here but it's hurting my brain... lol any advice would be appreciated. thanks everyone
  9. hahaha. my Point object plugin uses parameters in the OIP to create a 3d object. I want the user to be able to save that as a symbol so it can be used in the future without having to recreate it. I know you can manually do this with the "Create Symbol" menu command and having "Convert to plug-in object" selected. I'd like to make it easier for the user by making that a button in the OIP. vs.DoMenuTextByName("Create Symbol", 0) is a workaround but doesn't select "Convert to plug-in object". both vs.DoMenuTextByName("Symbol to Group", 0) and vs.DoMenuTextByName("Shallow Symbol to Group", 0) return an error that those menu commands don't exist
  10. if you want another view... this is how I pull info for selected objects. import vs objects = [] ### Main Runner def start(): vs.ForEachObject(collect, '((VSEL=TRUE))') vs.AlrtDialog(str(objects)) ### Collect all the selected items and sort them def collect(handle): hrecdef = vs.GetParametricRecord(handle) recname = vs.GetName(hrecdef) if recname == "3D Locus": fpoint_info = [] fpoint_info.append(handle) fpoint_info.append(vs.GetLocus3D(handle)) objects.append(fpoint_info) return None
  11. I know it's possible to create a symbol of a PIO from the menus but you think it's possible to have a button in the OIP of a point object that will export itself as a symbol into the current drawing using the "Covert to plug-in object" option. I tried calling vs.SymbolToGroup() but that just replaces the whole PIO as a group and doesn't save it to the resource browser.
  12. @twk anwser was what I needed. vs.SetObjectVariableBoolean(handle, 1160, False) solved my issue. thank you.
  13. hey guys, I hope it's as simple as me missing something... I'm trying to add some text to a generated 3D object inside a Point Object but if I use vs.CreateText() it only lives in the 2D layer of the object. I've tried using vs.Move3DObj() and vs.TrueTypeToPoly() with no luck. ideally only want this text to be on the 3D layer.
  14. hey everyone! I'm poking this bear again... just confirming that there's still no way to read records of symbols in another file. the idea of importing the symbol, checking the records, then deleting is very slow since the other files can have lots of symbols. i can make it somewhat better by breaking up the symbols int subfolders but then I'm relying on the end user to maintain that idea.
  15. conveniently enough this is how I treat all my plugins that have dropdowns. most of my "dynamic" plugins hold all the required data in a JSON file that lives in the user folder (which gives the user the ability to add/edit the data in a dialog box) I'm slowly going through and updating my plugins to support dynamically updating popups based on that JSON file. what I need to test is when a user has different options in that JSON file than another user and handle that accordingly. I'm currently learning how to make my plugins as dynamic as possible and try not to include any hard values in my code.
  16. that's what i was afraid of... so is there a safer way to dynamically populate a popup? i haven't run into any issues yet but I'm still kind of early in my testing.
  17. I was just coming back to say that I think I figured it out by repopulating the list when event 41 is called. I couldn't remember the webpage where it says what Event 41 does so I tried it anyways. lol Def start(): theEvent, theButton = vs.vsoGetEventInfo() recname = vs.GetName(recordHandle) if theEvent == kObjOnAddState: vs.vsoStateAddCurrent(PIO_handle, theButton) elif theEvent == 41: quick_update() ### Populates dropdowns with correct info elif theEvent == kResetEventID: goodguy = check_license() if goodguy: mainloop() else: #vs.AlrtDialog(str("hmmm... you can't sit with us")) lockedout() vs.vsoStateClear(PIO_handle) return None
  18. as far as I know, there's no way to have a PIO listen for other plugin changes. if it was 2 of your own plugins you could have 1 reach out and update the other but not with built in VW plugins.
  19. hey, so I'm using vs.vsoPrmName2WidgetID() and vs.vsoWidgetPopupAdd() to fill out a dropdown based on other fields so the values in the list should be unique to the current instance of the PIO. it seems to change ALL instances of the PIO and not just the one that I'm currently working with. is this an expected behavior or should vs.vsoWidgetPopupAdd() only be updating the current instance of the PIO? Here's an example of my code... ok, parmid = vs.vsoPrmName2WidgetID('', 'Product') vs.vsoWidgetPopupClear(parmid) vs.vsoWidgetPopupAdd(parmid, f"None", f"None") vs.vsoWidgetPopupAdd(parmid, f"-", f"-") for i in range(len(mylist)): vs.vsoWidgetPopupAdd(parmid, f"{mylist[i][0]}", f"{mylist[i][1]}")
  20. so I've thought about this more... I guess what I'm trying to do is skip the kResetEventID and not redraw everything if certain conditions are met.
  21. sweet! using Newtons as the force should be fine for me. i can convert that to pounds pretty easly. thanks!
  22. that seems to be returning false every time. my plugin is already event based.
×
×
  • Create New...