Jump to content

spettitt

Member
  • Posts

    348
  • Joined

  • Last visited

Reputation

183 Spectacular

6 Followers

About spettitt

Personal Information

  • Location
    United Kingdom

Recent Profile Visitors

3,097 profile views
  1. Slightly nit-picky thing but it would be nice if all of the content could be batch renamed L'Acoustics to L-Acoustics. Would save having to rename things as they are used from the library.
  2. Thanks, duly noted. This is generally working pretty well. I've added a popup parameter to choose the number of colours required from one to three, which creates the same number of named classes to assign colours to, and the same number of colour cells in the tag. Only downside over a data tag is that a new position value in the truss won't trigger an update of the tag. I guess that is where things move in to event enabled, so I'll come back to that. Also, is there a way to force single-click insertion rather than click position > set rotation please? No big deal if not.
  3. Working: def PickTest(): linkedPos = 'Unlinked' bool, objName, objHd, recHd, wallHd = vs.GetCustomObjectInfo() if objName: x, y = vs.GetSymLoc(objHd) pointx = vs.PControlPoint01X + x pointy = vs.PControlPoint01Y + y point = (pointx, pointy) pickHd= '' #FindObjAtPt Process container = vs.Handle() list = vs.FindObjAtPt_Create(container, 1, 0, pointx, pointy, 100) count = vs.FindObjAtPt_GetCount(list) for i in range(count): pickHd = vs.FindObjAtPt_GetObj(list, i) vs.FindObjAtPt_Delete(list) #If a handle was found and if it's Truss if pickHd and vs.GetObjectVariableInt(pickHd, 1165) == 641: if(vs.GetRField(pickHd,'TrussItem','PositionName') != linkedPos): linkedPos=vs.GetRField(pickHd,'TrussItem','PositionName') vs.SetRField(objHd,vs.GetName(recHd),'linkedPos',linkedPos) vs.ResetObject(objHd) vs.Locus(0,0) vs.CreateText(linkedPos) text=vs.LNewObj() vs.SetClassN(text, 'Lighting-Position-'+ str(linkedPos),False) vs.SetPenColorByClass(text) PickTest()
  4. That did look promising, but looking at the function reference, there is a note of: Looks like VS:FindObjAtPt_Create, VS:FindObjAtPt_GetObj might be an option that supports a radius, which I will try, although the function doesn't seem to trigger intellisense which doesn't seem a good sign.
  5. I think part of the problem is that the control point coords are relative to the insertion point of the PIO, whereas I need to give vs.PickObject absolute coordinates. Will continue on this more tonight.
  6. I've gotten to this point. If I uncomment point = vs.GetSymLoc(objHd) and comment out point = (vs.PControlPoint01X, vs.PControlPoint01Y) then placing the PIO directly on the truss works fine and the text reclasses it self suitably. But as-is, it reports a valid set of coords but reports no handle. I don't know if it's something to do with the way I'm packing the tuple, but I usually have good results packing and unpacking tuples for x/y points. def PickTest(): #linkedPos = PlinkedPos linkedPos = 'Unlinked' bool, objName, objHd, recHd, wallHd = vs.GetCustomObjectInfo() if objName: #point = vs.GetSymLoc(objHd) point = (vs.PControlPoint01X, vs.PControlPoint01Y) vs.AlrtDialog(f'You picked point x-{vs.PControlPoint01X} y-{vs.PControlPoint01Y}') pickHd= vs.PickObject(point) vs.AlrtDialog(f'Handle is {pickHd}') if pickHd and vs.GetObjectVariableInt(pickHd, 1165) == 641: if(vs.GetRField(pickHd,'TrussItem','PositionName') != linkedPos): linkedPos=vs.GetRField(pickHd,'TrussItem','PositionName') vs.SetRField(objHd,vs.GetName(recHd),'linkedPos',linkedPos) vs.ResetObject(objHd) vs.Locus(0,0) vs.CreateText(linkedPos) text=vs.LNewObj() vs.SetClassN(text, linkedPos,False) vs.SetPenColorByClass(text) PickTest()
  7. No worries. It's part of a much larger project, and I can integrate the top-up script in to the next stage of the process, so it's a good solution all in all. Thanks for your help!
  8. That's right, yes. This was what I had: import vs ##################### # First - Reset the SktUUID Record on each socket in each Device prof group def SockRecord(h): vs.Record(h, 'SktUUID') vs.SetRFieldOpt(h, 'SktUUID', 'Dev', True, True) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) def DevSockAddRecord(h): hprofile = vs.GetCustomObjectProfileGroup(h) vs.ForEachObjectInList(SockRecord, 1, 0, vs.FInGroup(hprofile)) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) vs.ForEachObject(DevSockAddRecord, "PON = 'Device'") ##################### # Then go through each Device and post it's Self UUID. # Devices first because they are at the top of the relational chain def DevUUID(h): UUIDv = vs.GetObjectUuid(h) vs.SetRField(h, 'DevUUID', 'Self', UUIDv) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) vs.ForEachObject(DevUUID, "PON = 'Device'") ##################### # For each socket, post it's self UUID and then reset it, so it picks up the Device UUID def SockUUID(h): UUIDv = vs.GetObjectUuid(h) if UUIDv: #vs.Message(f'Found a socket {UUIDv}') vs.SetRField(h, 'SktUUID', 'Self', UUIDv) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) def DevSockUUID(h): hprofile = vs.GetCustomObjectProfileGroup(h) vs.ForEachObjectInList(SockUUID, 1, 0, vs.FInGroup(hprofile)) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) vs.ForEachObject(DevSockUUID, "PON = 'Device'") ##################### # Then go through each Circuit and post it's Self UUID def CircuitUUID(h): UUIDv = vs.GetObjectUuid(h) if UUIDv: #vs.Message(f'Found a circuit {UUIDv}') vs.SetRField(h, 'CircuitUUID', 'Self', UUIDv) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) vs.ForEachObject(CircuitUUID, "PON = 'Circuit'") # Resets for good measure def refreshskt(h): vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) def refreshdev(h): hprofile = vs.GetCustomObjectProfileGroup(h) vs.ForEachObjectInList(refreshskt, 1, 0, vs.FInGroup(hprofile)) vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) def refreshcircuit(h): vs.ResetObject(h) vs.SetObjectVariableBoolean(h, 1167, True) vs.ForEachObject(refreshdev, "PON = 'Device'") vs.ForEachObject(refreshcircuit, "PON = 'Circuit'") Which produced the below:
  9. @Jesse Cogswell - thanks so much for this! I hope over time I can give back to this forum in the way it's given to me. I've got your first example running nicely with Vectorscript, and my next task will be to rewrite in Python so I can see how such a PIO might handle the same task. From there, I don't think it'll be too hard to pull the truss data and class the PIO geometry. I have two other big Python projects on outside of Vectorworks (though using Vectorworks data), and I don't think my little mind can handle looking at events right now. If I can get the simple version working, potentially with the 'Lock' parameter, that would be great for the moment and I'll come back to the events thread above when the time is right.
  10. Thanks for this @Nikolay Zhelyazkov. Adding that line does indeed give me the parent device, but did then affect the sockets getting their self UUID. However then a follow-up script just to write the socket self UUID got me the full house. For what it's for, I don't mind two scripts, so this is great. Thank you.
  11. Hi @Nikolay Zhelyazkov, I've kept trying at this but I'm just stuck at what feels like the final hurdle. Could you have a quick look at this file please? There is a script and worksheet. It's all working except for sockets storing their parent device UUID: Once I've run the script and the worksheet is populated, I can edit a device and see that the field is by-instance, even though it's not set as that in the Data Manager. If I toggle that by-instance to calculated, it does show the Device UUID, and then recalculating the worksheet will show it. But that has to be done for every socket. Any ideas on how I can get it to go straight to calculated, please? ExportTesting2.vwx
  12. Thanks for clarifying @Nikolay Zhelyazkov. I need to put some time in to figuring out the best way to make the association. I guess it needs a 'Pick Truss' button in the OIP, as it wouldn't know which Truss object to associate to otherwise. Or maybe the PIO should figure out the nearest Truss object and use that. An evening project I think...
  13. In terms of the 3D tools in the detailing toolset (i.e. I-Beam 3D), I don't really know what their relationship is to the structural member tool. I suspect the 3D detailing tools have been there for a while and the Structural Member is a more modern, all-in-one tool. Sometimes older tools/commands remain in the software for those that are used to them or have templates/processes that rely on them. As for the 2D detailing tools, it's quite common (in my experience) for engineers to model a whole structure without necessarily drawing every nut and bolt in 3D, and then place a separate 2D detail view showing a typical connection in full detail - detailing. In the world of BIM where each object has to exist in 3D to be part of the model exchange process, I think it's probably more common that steelwork designers are modelling each connection in detail, but I certainly know engineers who still do a 2D detail view on a sheet of a typical connection in the structure.
  14. Have you tried the Structural Member tool? Should be in the Rigging toolset for you most likely. You can choose from all sorts of standard SHS and RHS profiles. It's possible to add your own 2D profiles to be used by this tool as well, but chances are if you're using steel it's going to be standard RHS.
  15. I had a look at that as well. I think my next attempt tomorrow will be a standalone Point PIO that replicates a data tag, rather than within a data tag. I just need to have a go with making an association to another object. Hopefully it doesn't need to be event enabled as I haven't reached that yet. It only needs three named bits of data from the associated truss parameters, two bits to display values of and one to set the class.
×
×
  • Create New...