Jump to content

JBenghiat

Member
  • Posts

    2,181
  • Joined

  • Last visited

Reputation

1,025 Spectacular

Personal Information

  • Homepage
    https://www.benghiatlighting.com
  • Location
    United States

Recent Profile Visitors

16,929 profile views
  1. To add to @Jesse Cogswell’s questions, the easiest approach is to edit the symbol programmatically, so if the user actions are limited, you can just add to the symbol definition. For example, draw a rectangle in the drawing with a custom tool, then add the rectangle to the symbol definition, translating world coordinates to the symbol’s coordinates. if it’s free editing, the Vectorworks approach is to provide a shortcut for selecting the symbol in the Resource Manager.
  2. Overall this seems fine. You don’t seem to be using curdate. FWIW, the string repository clears when you quit VW, so you are guaranteed a check once per session without using a date stamp. The date could come into play if you have a time-based demo or perform a periodic update check. I may be wrong, but I think for this to work, you need to have the plug-in menu in your workspace. You are ultimately better off using PythonExecute(). 1. Set the python path to where you install your helper script, and begin a context 2. Call PythonExecute(‘import tool_check_thisone’) 3. Call PythonExecute (‘tool_check_thisone.start()’) You can find tools for obsfucating Python files directly, so you don’t need to make a plug-in. If you update get_serials() to take an argument (the string repository name), you don’t even need the intermediary.
  3. To keep the python workflow, you could construct checkserial as a module, so so that the PythonExecute calls would just be 'import checkserial' 'checkserial.check()' You would want to obfuscate your python file and probably set the python script path. The python call would set a value in the string repository that your main code would check. In the SDK you can indeed create your own VS and Python commands, which you can then just call from your script. That easily lets you use the same code for VS, SDK, and python plug-ins.
  4. I've never tried it, but I think the #INCLUDE directive is fairly "dumb", and may work to include the contents of a python file. You may have to work out a way to wrap it in single quotes. You also need to stick to double quotes in the python file to ensure that PythonExecute is taking a string.
  5. Open the Visualization palette and double-check that the lights are on there. That is the definitive indication of a render light being on. In Shaded, try turning cast shadows off. If that makes a difference, your lighting symbols are using a texture that does not allow light to pass through them.
  6. Do you need to just reset them or do you have a deprecated parameter or stored value that needs to change. For the latter, you could do a ForEachObject and call a ResetObject on them, but also going into the plug-in manager and making a change (like adding a space) will cause a reset on exit. For the former, use a version parameter to make them self-fixing. If the version is less than the current version (or empty), update necessary parameters, as well as the version field.
  7. https://github.com/Vectorworks/developer-scripting/blob/main/Function Reference/Functions/PythonExecute.md Last I checked, the described method for passing data didn’t work for encrypted scripts; you have to use the string repository (Get/SetRepStr commands).
  8. If you are attaching a record directly to the Lighting Device or rigging object, then the Data Manager will do this for you. Take a look at how the Data Manager handles the Rigging Object Info record that attaches to all rigging objects. For Lighting Devices, you can use the Additional Record settings specified in Spotlight Preferences to have additional data attached to symbols automatically populate Lighting Device fields. If this is your need, send me a personal message — I may have a solution for you that I'm currently testing. You can't concatenate the name of a constant or variable. I do recommend using constants for field names, e.g. kFieldNameGel = 'color'. In VS, you're going to have to write a series of if/then statements to map the field to the constant (which you can make a function); if inField = 'myField' THEN MyGetConstant = kSpotlightConstant. In python you can set up constants as a map, which is much easier.
  9. @kaj5021 can you give some sense of your end goals? If its to dynamically fetch field data, GetRField takes a string for it’s field parameter, so you can construct a string to retrieve the desired value. Note that if this is for another plug-in, you need to use the field’s universal name, which you can find when working with worksheets. if it’s to set and retrieve a variable number of data, your best approach is to serialize the data and store as a string, which is what Pat is describing. If you have an event enabled plug-in, you can even dynamically add widgets to object info to access the data.
  10. Plug-ins get created in your User/Plug-ins folder. (See the VW preferences for its location). That’s it. Just copy one from one user folder to another. I believe you can also share plug-ins via a workspace folder, but I haven’t done that in a while. Make sure VW is not running when you modify the Plug-ins folder. If your code uses includes, the process is slightly more complicated— you either have to also copy the include files using the same folder structure, and make sure all your include paths are relative, or use .px files and encrypt the plug-in. Loop back here for more info.
  11. @SamIWas, my method is somewhat similar to @Jesse Cogswell's. If you (or anyone else on this thread) want to DM or email me, I'd be happy to give some more details; too many details of the protection system make out in the open it easier to exploit.
  12. The Hanging Position object doesn't have a length field, and you're actually looking for the aggregated length of the truss items contained in the position. You could use the Width worksheet formula, as long as the position remains aligned horizontally. I'll also shamelessly plug Savvy Position Label, which in addition to the label objects, provides worksheet formulae that you can use with data tags. See https://benghiatlighting.com/support/docs/savvy_position_label/5.0/function-reference.html and https://benghiatlighting.com/support/docs/savvy_position_label/5.0/data-tags.html They are designed to work consistently across Hanging Position, Truss, Straight Truss, Curved Truss, Pipe, and Ladder objects.
  13. Variables don’t persist between events. You can use the string repository, which preserves for each session. I recommend doing the check during the Init event.
  14. Short answer— yes. Use CreateCustomObject() to insert and SetRField() to set the parameters. I don’t know the particulars of setting up the Panel object, which may also require dealing with objects in the profile group. You may be able to insert a style as a symbol, but I haven’t tested.
  15. You definitely don’t want to hard code any licensing information. I can’t envision a system that doesn’t involve reading a license key from a text file. You can decide if you want one key per file or have a json or xml file that includes keys for all your plug-ins. You can also use Vectorworks saved settings calls, but then you run the risk of the user needing to re-enter the key if VW crashes. You can either encrypt the seat ID in your key or use a remote server to authorize a key to a seat ID. In my keys, I include the seat ID so it’s clear which seat the license belongs to, and use a checksum so that the user can’t just change the plain text of the seat (or product or version). Again, if I were to start from scratch, I would use the remote server approach for ease of sales and service. I would also use Python for file read/write and any network connections. You can pass the Python data to and from VS. To get an idea of what a non-registered user sees, simply remove the plug-in from your plug-ins folder, open VW, then open a file that uses the plug-in. You’ll observe what Pat describes above. Your other option would be to use a merchant system that only provides a download link after the purchase is complete. You could also always verify that you only offer support to registered users. Nothing would stop users sharing with friends or using a single license on multiple installs at a company, but you can do a cost benefit analysis of the number of lost sales due to “illegal” sharing vs the time needed to implement a locking system. Also up to you the degree users THINK there’s checks vs actual checks.
×
×
  • Create New...