Jump to content

JBenghiat

Member
  • Posts

    2,016
  • Joined

  • Last visited

Everything posted by JBenghiat

  1. The symbol insertion code is a one liner: https://developer.vectorworks.net/index.php?title=VS:Symbol You would ultimately want to do some error checks to make sure the named object exists and is of type symbol definition.
  2. @spettitt are you just looking for the label to adopt the class of the rigging object it’s attached to? If so, I think this would be a fairly straightforward feature to add to Savvy Position Labels.
  3. You seem to be describing a Plug In Object. PIOs will create their own insertion tool, with the interface for a point PIO being very similar to the symbol insertion tool. The script component for a simple PIO should draw the elements you want to display, with the origin of the scripted elements being the insertion point of the object (like a symbol definition). Your script can insert a symbol at the origin. You can also code all the geometry of the elements you want to draw, and it will appear symbol-like to the user.
  4. If it’s for a document-wide setting, you don’t have to attach the record to anything— just use the default field values to store your data. You can get a handle to a record definition by its name.
  5. Seconding Pat's suggestion. Create symbols instead of viewports. Once you're ready to start assigning control data, Convert to group (this is a named command, not to be confused with Group to Ungroup). You can think of a viewport as a smart photocopy -- a way to duplicate a drawing element for presentation or to show an alternate position.
  6. The double underscore will hide a field. To hide a record, use SetObjectVariableBoolean on the record format with the selector 900. (True is hidden). Usually I check if the record exists, if not, create it, then hide. The record otherwise functions as usual, and you can create a script to toggle visibility as you're testing.
  7. Files definitely do not have unique id’s. In fact, I think that’s a feature— if you were to save a backup or a named version, you would want the file to be identified the same. Storing a UUID in a hidden record would be the way to go, but you would need some kind of manual connection setup between the file and database.
  8. You’re creating a bundle, though you may also want to start with the EmptyModule or TesterModule component example and build from there. Last time I tired, I still needed to change some project and build settings to get things to compile and run, but that was a while — I have custom xconfig files adapted to my development file structure and flow. I’ve recently started migrating to a cmake workflow. After getting past the learning curve, setting up new projects, supporting multiple Vectorworks versions, and working cross platform has become much easier.
  9. You still need to define the object being extruded, so don't omit the BeginPoly/EndPoly calls GetCustomObjectPath works on Plug-in objects -- that won't get the extrude base, as an extrude is a native object type. Use OffsetPoly after EndPoly and before EndXtrd.
  10. If this is part of a PIO, use BeginXtrd/EndXtrd instead of HExtrude.
  11. I think want to use AddPoint() or Add2DVertex() in your polygon. Also make sure to call SetPolyClosed() to ensure it is a closed object and can extrude. By your screen shot, it looks open. Using DoMenuText calls in code that also uses handles can be problematic and is definitely not reliable in a PIO.
  12. Have you tried the outer boundary mode of the polygon tool? Otherwise, you’re interested in a concave hull algorithm. You may be able to find some existing python examples, but I don’t think you’ll find a simple code snippet that someone can provide.
  13. Not entirely sure what you’re describing. Tools>plugins>run script will run a text file as a script You can also create a script in the Resource Manager and run from a script palette. It saves with the file, not as a plug-in.
  14. Short answer -- no. The clip club is just essentially a view. The criteria is actually looking at a visibility flag that's set on objects (which really dates from pre-viewport days) and their containers (i.e. whether their containing layer is set to visible). Your worksheet isn't going to change if you're zoomed in on a group of objects, for example. The Clip Cube doesn't change any visibility flags, it just filters what gets displayed on screen. From a script standpoint, you could retrieve the clip cube, get its location and dimensions, then parse objects and test if they exist within the cube -- but that is not a small task.
  15. Yes, sorry, I was going purely on memory. vs.Move3DObj() is the call. https://developer.vectorworks.net/index.php?title=VS:Move3DObj If you're not familiar with the concept oh handles, you can find a few threads here and on the Vectorscript forum. You would get the handle to the symbol with vs.LNewObj() and then pass that to the move command.
  16. You need to use HMove3D() to set the height after inserting the symbol
  17. Thanks Andy and Sam! ProjectionViz 2 will rotate the projector to the tilt and generate the hybrid Top/Plan view. It will also let you choose the floor plane for visualizing the projector cone (as well as correctly displaying key stoning and lens shift). The Video Screen tool is going to give you a lot more options for showing the details of the projector mount and screen, while ProjectionViz is more targeted towards planning and visualization. It is currently Braceworks but not ConenctCAD compatible. https://benghiatlighting.com/software/product/projectionviz-2/#description
  18. This would be fairly straightforwards to script. I would use python in order to take advantage of built-in list functions. Perhaps obviously, all the lighting devices would need to be in the same layer for the stacking order to apply to the full range. - Use ForEachObject() to build a list of Lighting Devices, with a dictionary holding the handle and channel number - Sort the list by the channel - Iterate through the list, using HMoveBackward() on each handle Alternatively, the mvr file is just a zip that contains the plot as an XML file. You could write a python script that sorts the XML entries by the FixtureID element. That's probably something ChatGTP could handle.
  19. I feel like with criteria, you can never have too man parentheses, but at least the outer-most set is redundant. You don’t need more quotes than with vs, so just record and field names, object names, etc. Should have single quotes.
  20. In Python, the entire criteria needs to be a string
  21. In this case, I think you can just increase the conditions under which you would select the object: OjbAngle == Rotation or OjbAngle == Rotation + 180 or OjbAngle == Rotation - 180
  22. Just flagging that this is in the VectorScript forum, but your code is in Python. This is one of the few things that VS does more easily: you can just specify units, i.e. CreateShell(h, 2”). In Python you have to do unit conversions. vs.ValidNumStr is the most robust https://developer.vectorworks.net/index.php?title=VS:ValidNumStr Just to throw a wrench in things, I believe some functions always take millimeters, and this may be one of them. Best practice there is to retrieve the units per inch preference, and convert input numbers into millimeters.
  23. You can use data tags to individually label each piece of truss. My Savvy Position Label tool allows you to summarize the components of a truss system or truss line: https://benghiatlighting.com/software/product/position-label/ Also look at the truss tags in Sam Jones’ AutoPlot: http://www.autoplotvw.com/index.htm
  24. I developed Savvy Select Similar Instrument for exactly this purpose. The Select Similar tool doesn't access specific Spotlight data: https://benghiatlighting.com/software/product/savvy-select-similar-instrument-3/
×
×
  • Create New...