kevin.hayward Posted April 6, 2023 Share Posted April 6, 2023 With much gratitude to Pat Stanford, JBenghiat, Sam Jones and Jesse Cogswell (btw, how'd I tag them in a post?) I got my script complete, as shown . It takes an imported spreadsheet, with a key to lighting devices, and the user (via a popup list) gets to assign actual lighting devices to the key, then inserts the correct lighting devices with all relevant data attached. My question is about the resource popup. I'd like it to default to a blank image. In the screenshot, I have imported the CSV and simply selected a key entry, yet the popup shows the clamp object. 1. I don't want key A to refer to the clamp. 2. It doesn't anyway. I'm using the popup events to assign the symbol to the key. No event, no key. 3. Although it doesn't show here, once I have set key 'A' to a device, when I select an empty key the popup doesn't change. It swaps nicely between assigned keys, but the control doesn't change when choosing an unassigned key. I'd like an unassigned key to blank the popup. Is there a way to add a 'blank' entry to a popup? Something like: PopupIndex = vs.InsertImagePopupResource( dialog, dlg.kLightPopup, None, 0 ) Thank you. Quote Link to comment
JBenghiat Posted April 6, 2023 Share Posted April 6, 2023 As far as I know, there is not, other than creating a temporary empty symbol. Quote Link to comment
kevin.hayward Posted April 6, 2023 Author Share Posted April 6, 2023 10 minutes ago, JBenghiat said: As far as I know, there is not, other than creating a temporary empty symbol. That sounds EXACTLY what I was looking for. tmpSym = "no key" vs.BeginSym(tmpSym) vs.ArcByCenter(0, 0, 1, 0, 360) vs.Rect(-1, -1, 1, 1) vs.SetPenFore(vs.LNewObj(), vs.RGBToColorIndex(65535, 65535, 65535)) vs.EndSym() vs.InsertImagePopupObjectItem(dialog, dlg.kLightPopup, tmpSym) Seems to be doing what I want. Except it leaves the symbol in the drawing, visible in the resource manager. How would I create a genuinely temp symbol? As for the second problem, the popup not switching to the blank icon... turns out the popup list is 1-based. Oh well. You live 'n' learn... 😄 Thank you, once again. Quote Link to comment
kevin.hayward Posted April 6, 2023 Author Share Posted April 6, 2023 vs.DeleteSymbolDefinition(vs.GetObject(tmpSym), True) apparently 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.