Jump to content

JBenghiat

Member
  • Posts

    1,826
  • Joined

  • Last visited

Reputation

695 Spectacular

Personal Information

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

Recent Profile Visitors

7,411 profile views
  1. Just flagging some cross-nomenclature here. @Sam Jones, you're referring to multiple emitters in a lighting device symbol definition. In this case, you're only going to have one render light per cell in the profile group that masters each set of emitters. (You do need to check for multiple lights for multiple cells). @Jesse Cogswellis referring to the emitter properties of a light object that allow it to behave more realistically.
  2. It depends what you want to do with the light. The light that appears in the Viz palette is in the profile group of the object (which is true for all PIO’s that appear in Visualization). This is what allows you to edit the light via Viz and have the modifications persist. (That is, the light doesn’t redraw of every regen). You start with getting a handle to the profile group and then iterate through the objects until you find the light. There’s also a light that gets placed inside the object geometry. Due to a myriad of reasons, this geometry is not so easy to parse. Do some exploring with Debug List View. If I remember correctly, the geometry is in the aux list, which means you can access via Python but not VS. But depending on what you are doing, you may not need to access this light.
  3. Agreed -- the rectangular PIO UI is a little wonky. The simple answer is no-you can't eliminate one of the modes in vs/python. You can, however, create a separate custom tool for placing the object. If this is for your own or internal use, just have the tool draw a rectangle, then place and size the PIO accordingly. (Note that for box-type PIO's, regardless of the insertion procedure, the origin is still the left-center). If you want the PIO to always be associated with the tool, see here: https://developer.vectorworks.net/index.php/VS:Similar_Objects_Creation This will cause the tool and PIO to behave as one object. Coding the clipping in vs may be a little challenging. You can set the PIO to have a profile or path group, with you then use to find the intersection. I'm not aware of a way to have VS select the face of an objet, which is what you need to automatically create the shape that goes into the profile group. Again, if this is for internal use, your best route might be to writer a menu command or venture into event-enabled plug-ins to add a button in the PIO that uses the selected object as a clipping mask. You would first have to use the extract surface tool to extract a 2D shape you want to use for clipping. The other strategy would be to add four control points at the corners of the diagonals and use those to set the end points.
  4. Turning off all the lights won't turn on the default light. @Pat Stanford's suggestion will work -- if all the light-generating objects are in a hidden layer or class, Vectorworks will create the default light. If you're working with Lighting Devices and still want to see their geometry, this isn't really a viable solution. I recommend replicating the default light. Go to the Visualization palette, activate the Light tool, and place a Directional light (the first mode, that looks like a sun). It can go anywhere in the drawing. In Object Info, deselect the Cast Shadows option. Use @markdd's suggestion to turn all the other lights off via Visualization. While the light won't adjust to your view like the default light, which is always over your left shoulder, it works pretty well for general illumination.
  5. For Python you are creating a standard import file or module, and the rules are a little different. I think the python form includes some relevant posts. For VS, create a vile with the extension .vs, .vss, or .px. px files will include and encrypt themselves for locked plug-ins. They also work for unencrypted plug-ins, so that's what I tend to use. The syntax is {$INCLUDE filename.extension}. You can see more in the Vectorscript Language Guide: https://developer.vectorworks.net/images/7/72/VectorScriptGuide.pdf If no path is provided, Vectorworks will look for a file in the same directory as the calling script, which if called from a plug-in, will be in the plug-ins folder. You can also include an absolute path or a valid POSIX path (including relative paths) to access the include file anywhere on your system.
  6. No, you can’t call one script from another. If you want to share code among scripts, you can use include files. In VS, an include works as though the external file were inserted at the point of the include statement.
  7. There's an SDK for c++, which the bot seems to be adapting. VWObjects is a class, but GetAllObjects() isn't in either the SDK or the Python/VS API. GetBounds() is not an actual method, though GetObjectBounds() is, which returns an object with GetLeft() etc. The logic of the AI-generated script is actually sound, but it's almost as though it wrote what *should* be the API first. 🙂
  8. You can think of the Vectorworks file format as an xml-like node tree with parent, container objects that contain child objects. Layers, groups, and symbol definitions are all examples of container objects. In traversing a list, if an object is a container, you go into the container, iterate through objects until the last contained, and then continue with the object after the container. So, in the case of layers, you iterate through every object in the layer, then move to the next layer. You can get some sense of the structure here: https://developer.vectorworks.net/index.php/SDK:The_Vectorworks_Environment Traversal is via object's stacking order, from bottom to top. Unless you do a Send Forward/Back, this will be from oldest object to newest. Selection state is just a true/false flag for each object, so iterating over selected objects still goes in stacking order, but also checks if the selected status is true.
  9. Oh, one more thing: If you're looking for a method of rapid prototyping, take a look at Marionette. You can convert a Marionette network into an object, and any named inputs become parameters. You can even export your Marionette to a python script, though for simple objects it may be a bit bloated. I suppose in theory you could create a PIO completely based on Marionette code, but I haven't experimented enough to know if that's also more complicated than it's worth. http://developer.Vectorworks.net does have some information on coding Marionette nodes.
  10. Widgets aren’t fundamentally different from parameters — behind the scenes VW creates a widget for each parameter. You should not have to restart VW to see parameter changes. - VW will only update objects in the current document - The OIP redraws when an object is selected. Usually clearing the selection and then re-selecting the PIO will refresh the OIP. - Occasionally, the OIP needs a kick start for existing objects: right-click on the object and select Properties…. Change a parameter so that the object regenerates. Click ok. This will usually get the OIP to display your changes.
  11. I suppose it's possible, but not easy. The Parameters window will create a record format and fields to match your parameters. If you are using widgets without associated parameters, then you need to create that record yourself, and use the following workflow: - On object creation, check if your record format for storing parameter data exists - If not create the record format - Attach the record format to the object - Use state eventing to determine if a widget has changed value - On widget change, write the new value to your custom record attached to the object - On object reset, use GetRField to read values You'll also have to provide your own routines for viewing and setting object defaults.
  12. Presentation values are merely for seeing a mock-up of the dialog with Dialog Builder. You still have to code the dialog handler. When testing the dialog with DB, you can see the temporary code in your user folder, which can serve as a guide for developing your handler. You can also use DB to save additional strings that you can use for your options, which is useful if you intend to localize your plug-in.
  13. If only those calls were actually in the VW Python api…
  14. If you're placing lights from scratch, you can use duplicate array to evenly space units around an arc. Otherwise, there's not really a command to distribute objects around an arc. Usually, I'll use a curved Lighting Pipe, and snap to tick marks to get even spacing.
  15. And just to make sure, after setting initial values, call: this->UpdateData(true);
×
×
  • Create New...