Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

278 Spectacular

About JBenghiat

  • Rank
    1000 Club

Personal Information

  • Homepage
  • Location
    United States

Recent Profile Visitors

3,733 profile views
  1. The constants are documented: https://developer.vectorworks.net/index.php/VS:vsoStateGetExitGroup though you don’t pass a value, the function returns a value to tell you what group was edited. You only get a notification that the path group was entered and exited, not whether there was an actual change. There also a reshape state change, but I think that will not be true for a path group change. But as you are really just interested in the end point changing coordinates, you may just want to keep it simple and just always check if the end value is the same as the stored comparison value. I think the overhead in processing states and comparing the values is about the same.
  2. @Raymond All the object variables >9000 I've learned from private discussions or posts to the list (and I think all from the listserv days).
  3. vsoStateGetExitGroup should do it, even if reshaped with the tool. The new location should be the current location. The old location would be harder to get — I think the only option is to store it in a hidden variable.
  4. The following will edit the symbol at the conclusion of the script: SetObjectVariableInt(SymDefHandle, 9743, 0); You can also get a handle to a symbol definition simply with GetObject() instead of using the resource list.
  5. You can’t create a pop up field. VS wasn’t updated to accommodate the newest round of field types, which includes the pop up. This is technically a bug.
  6. Something like the scale dialog, definitely. RunTempTool() allows for a number of tool actions to be called from a script. Getting a preview of objects more than a line or a rectangle is not possible with VS. FYI, the API for VS and python is essentially identical, with python having a larger native set of commands and allowing access to any installable module.
  7. I would use the parametric record. That will be guaranteed to be correspond to the Truss settings. I don't think the Truss Record updates to reflect changes — it's meant more for defaults. Do you mean symbols or an HP made of Truss objects? Either way, you have to iterate through the HP geometry, determine what kind of object it is, and then decide how you want to determine the length of each object type. If you're looking at symbols of trusses, then you have to enter each symbol definition and analyze the geometry. Sadly, no. I don't think Spotlight is really designed to allow a lot of script access, and only a fraction of the interaction is available through VS.
  8. The light info record is for setting default data and should only be attached to symbol definitions, so if you create a report on drawing objects, you aren't going to get this data. If you want the data to appear in Lighting Devices, do the following: Open Spotlight Preferences, and select Parameters. Change the name of one of the user fields or add a new parameter with the name "Remarks." Exit preferences and open Spotlight>Reports>Lighting Symbol Maintenance. This shows all the Light Info Record data for your drawing. The Remarks field maps to Notes. Make any changes here if desired. Click the Update all lighting devices button at the bottom-right. This will push all Light Info data to existing Lighting Devices. You should now be able to report on the Remarks field for all Lighting Devices. If you already have the Remarks field added to your Lighting Devices before you insert them, you can skip steps 3-5.
  9. You should be able to get the name of the resource before you import. You cannot get handles to objects outside of the current document, as only objects from open documents get loaded into memory. Generally, I will use GetObject for each name on the list, and if the handle is nil, import the resource.
  10. The constraints in VS should be identical to how they function manually: http://app-help.vectorworks.net/2020/eng/index.htm#t=VW2020_Guide%2FBasic3%2FParametric_constraints.htm You can also try setting constraints in the document and then exporting to script.
  11. Other associations only tell objects how to find each other. You still have to manually code thing like having one object move another or reset another. Depending on what you are doing, you can look at constraints. Constraints have been around a while, and their interface is not the most elegant, but this is what allows dimension lines to attach to objects. You can manually experiment with constraints in the Dims/Notes palette. https://developer.vectorworks.net/index.php/VS:Function_Reference#Parametric_Constraints Otherwise, you can connect event enabled objects via responses to state changes. For example, this lets you identify when an object moves: https://developer.vectorworks.net/index.php/VS:vsoStateGetPos. In VS, you can only look at state changes for objects you code. You can't, for example, receive a notification when a Lighting Device moves.
  12. Not quite as straightforwards, but you can export a script of your whole file: File:Export:Export Script. If you're trying to get started creating geometry, this is a great technique. In the case of a setting, you could export both options and compare the files. Not everything gets captured, though, so it wouldn't help you in this case.
  13. Yes, but they tend to be managed by other functions, so the constants aren't really well documented. You can use GetNumAssociations() and GetAssociation() to explore. For example, Lighting Devices are associated with Rigging Objects, and Data Tags have associations with their objects. You are better off managing the later with DT_AssociateWithObj(), though.
  14. The handle is the parent object where you want the Viewport to appear, a layer or a group on a layer. https://developer.vectorworks.net/index.php/VS:ActLayer https://developer.vectorworks.net/index.php/VS:GetLayerByName
  15. I think the stacking order makes a difference. Make sure that you create your bigObject first.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...