Jump to content

kevin.hayward

Member
  • Posts

    38
  • Joined

  • Last visited

Everything posted by kevin.hayward

  1. That solved two problems in one. Filtering the resource list was my next problem. Thank you.
  2. One hates to be all necromantic 'n' stuff but... symbolName = 'My Light' hNew = vs.CreateCustomObject('Lighting Device', (-61,-7.55), 0) vs.Move3DObj(hNew, 0, 0, 11.5) vs.SetRField( hNew, 'Lighting Device', 'Symbol Name', symbolName) vs.ApplyLightInfoRecord(vs.GetObject(symbolName), hNew) vs.SetRField( hNew, 'Lighting Device', 'Pan', '-7') vs.SetRField( hNew, 'Lighting Device', 'Tilt', '46') vs.ResetObject(hNew) doesn't appear to be working exactly, yet. Don't get me wrong, you've got me this far and I am very grateful, and any problems are on my end. So when I run my script (including a nice little snippet of code I *ahem* 'borrowed' to populate a popup box) I only get simple boxes. There's lighting data attached, but it's all at default values. The problem: The script doesn't create the correct graphical symbol The script doesn't add the correct lighting instrument information Part of it is wrapping my head around how VW works with 'intelligent' symbols. In AutoCAD, a block is a graphical object that has a data attached (in the form of attributes). As far as I can see, a VW 'lighting device' (and similar) is a data that has a graphical symbol attached. My thinking is to get a reference to the definition of the lighting device, then extract the references to the symbol and data: LuminaireList, LuminaireCount = vs.BuildResourceList(16, 0, "") deviceHandle = vs.GetResourceFromList(LuminaireList, 0) symbolName = str(vs.GetRField(deviceHandle, 'Symbol Name')) Am I heading in the right direction?
  3. So I'm importing a CSV. I add each line to a ListBox for user review. To aid readability, I use vs.AddListBoxTabStop, then use the <string>.replace method to change commas to tabs in the CSV data before adding it to the list box (I'm going to parse the original data separately). The strangest thing is, when I run the script I only get two columns, even though there should be 6. The "documentation" (ha!) says that "This function will clear all data in the list control." "Ah," I think, "every time I call AddListBoxTabStop, it's clearing all the previous tabs." Except that when I run it and look through the data, the list box only shows the last column. I can change the column count and all that shows is the last column, whatever it is. Frex, the data contains a table of light#, X, Y, Z, Pan, Tilt values. I always get the light# but if I add one column, I get light# and X. If I add two columns I get light # and Y, and so forth. Evidently the columns ARE there and picking up data correctly, they're just hiding like a naughty toddler. Any ideas how to get all the columns to display properly? I can dynamically resize the list box at runtime and the other columns still don't show, so if it's an issue of the tab columns not drawing properly I have no idea how to fix it as there are no column grips in the control.
  4. Yes. I was looking to see how VW does it to see if I could get a better idea. The idea is to automate the placement of dozens of lights for sporting events. It's time consuming and prone to error, people get bored. Explicitly importing the desired lights BEFORE running the script? A coupla minutes at most in service of saving hours of grunt work? I can live with that. Thank you all for your time and input. Now I just have to work out building ResourceLists, but that's a question for another thread... if only VectorWorks had heard of this new cool trick called, wait for it, "documentation". 😄
  5. As I said, for the moment linking the key to an actual lighting instrument resource is SEP (probably future me, but he'll just have to suck it up). The rough plan is to populate an array with the key+reference and have the user select (via dialog) the relevant lighting devices from the resource manager, but I'll burn THAT bridge when I come to it. 1. Huzzah! 2. Yes, a Spotlight Lighting Device. 3. CreateCustomObject? From something Sam said upthread, I got the impression that I'd have to manually populate all the relevant lighting instrument information (power, weight, etc) with a 'custom object'. 4. Nah. Sounds too much like hard work. 🙂 Sam mentioned building a resource list. Surely that is what the resource manager is? A central source for ALL the information about a lighting instrument. I did try inserting a lighting instrument to an empty drawing and exporting to text. Unfortunately (as far as I can tell), calls to the resource manager aren't recorded. It reads as though the lighting instrument were created entirely WITHIN the drawing (as in, the way the commands are exported) with no external references (again, as far as I can tell). Thank you both for helping, genuinely. This is kinda frustrating because it should be relatively straightforward. After all, VectorWorks can insert references from the resource manager and populate all the data with only two clicks.
  6. Thank you for the response, but I'm still somewhat confuzzled. My question is simply, "If I can get a reference to a lighting device in the resource manager, can I insert said lighting device programmatically?" Getting the reference, associating it with a key etc etc are all currently under the job code SEP. 🙂
  7. If I understand you correctly, the answer is that it isn't possible to insert a Lighting Device (as if one were using the Lighting Device Tool) programmatically. I had hoped for some equivalent of (cue ghastly pseudo code): LightingDeviceRecord LDKeyRecord = GetFromResourceManager (LightKey[x]) LightingDevice NewLD = PlaceLightingDevice (LDKeyRecord , X, Y, Z) NewLD.Tilt = a1 NewLD.Pan = a2 NewLD.Dim = etc etc etc...
  8. We get data from Calculux, in CSV format: The requirement is to automatically populate a drawing with lights. The 'Qty and Code' field is a reference to a key. For example, in this case 'D' could be any sort of light; a flood, a spotlight, a wash, made by any manufacturer. Assuming it is possible to associate the key to a lighting device in the Resource Manager, is it possible to insert a Lighting Device (as if one were using the Lighting Device Tool) programmatically? I'm looking at the documentation of 'VS:CreateLight' but it's not exactly exhaustive.
  9. Well, according to the online help: So...? I set the 'current' object attributes in the 'Attributes' palette to 'by Class', but if “use at creation” is checked, VW will override these values with explicit values from the class? Seriously?
  10. Why? It's a genuine question. I don't see why there's an extra step. If I have set the default attributes to "by class", or any specific value, why wouldn't VW use those values? And if not, WHERE is VW getting the values it IS using using?
  11. #WS_REPLACE('CableObject'.'UsedPartsOrdered', ' ', CHAR(13))#
  12. Thank you for the response. I managed to fake it a bit by explicitly setting text box Width and WrapText properties, but that only works for cable part names of a certain length so it doesn't really do what I want. One hates to sound churlish, but if I wanted to create a worksheet, that's what I would have asked. I will have a group of riggers in situ running cables, trying to work as quickly as possible and it takes time to cross check tables against plans. In addition there's the admin overhead of ensuring the plans and tables are properly cross referenced. Having tags on the plans reduces time and errors.
  13. Although my specific problem is Spotlight related, I think this is a general task so posted here... that said, I'm looking at Data Tags, specifically cable tags although this would just as relevant to doors in a building, wall finishes, floor coverings, border flowers etc. There is a field for cable parts that, when populated, becomes one single line of text. To be honest, it looks ugly. I would like to be able to have a multi-line tag. The tag definition in this case is: #CableObject#.#UsedPartsOrdered# Is there any way to control the output of #UsedPartsOrdered#? I'm guessing the command iterates through the returned records and concats them with a space, whereas I'd like to use a newline. My larger question is, is there an in depth reference for tag fields? It is, essentially, a database query language and requires better references than https://app-help.vectorworks.net/2022/eng/VW2022_Guide/Annotation2/Creating data_tag_styles.htm#h and it's circular link:
×
×
  • Create New...