Jump to content

JBenghiat

Member
  • Posts

    2,028
  • Joined

  • Last visited

Everything posted by JBenghiat

  1. This is pure speculation based on the parameter names, but is it purely for dealing with the PIO parameter option of the eyedropper? Or at least the event only raises when the user checks the PIO option?
  2. Go to your Document Settings (File>Document Preferences), and turn on Adjust Flipped Text. This is usually on by default, and can be set independently in Viewports.
  3. The built-in script editor is fairly lightweight. See this section on using vs.py with an IDE: http://developer.vectorworks.net/index.php/Python#IDE_and_Debugging_Python_Scripts You can find the most update version of this file if you download the SDK and look in SDKLib/Include. (You don't otherwise need to use the SDK for python). Not only will this give you code completion in an external editor, but you can take advantage of syntax coloring, debugging, find and replace, etc.
  4. What version are you using? If you are seeing render lights in a viewport then you have discovered a bug. If you have the latest of 2018, 2019, or 2020, please report this.
  5. If you want a lighter weight solution, go to the Visualization tool set, find the render light tool, select the directional light mode (the one that looks like a sun), and insert anywhere in the drawing. In Object Info, you can turn off Cast Shadows, so that you don’t need to turn off Cast Shadows in OpenGL (useful if you’re looking at gobos or rendered shutter in BeamViz 😏). The default azimuth and elevation should be 45/45, but if not, set that as well. The only difference between the shadowless directional light and the default render light is that it doesn’t stay oriented to your screen. If you want to add a little more fill from the opposite direction, you can mirror the light and bring down its intensity in the OIP. To speed this up in the future, select the light (or lights) and create a symbol. Add the symbol to your go-to library. Alternatively, you can have the render light in a layer by itself, and add this layer to your template or Standards file. Import the layer to new drawings, selecting the option to include objects. This method is advantageous if you want easy control of of the light, as render lights are mastered by their layer or class. Simply toggle the layer on and off to control the global light.
  6. This sounds to me like a bug — I would report that. I’m also inclined to think the Set/GetRField commands still want the correct field name, without the extra “Y,” which may be different than the PParam access. And don’t forget about the reset issue. You won’t see the control points in the new position until after you reset the object.
  7. I think you have a number of issues confounding your troubleshooting. Was the screen shot of the param names from the Script Editor? If so, do they look the same in the Plug-in Manager? If so, my guess is that the extra Y is a Script Editor bug and that you’re not accessing the field. HLength() I not going to be accurate for polylines. The call that gets the perimeter is better (without looking at the reference, I think it’s HPerimeter() ). In the SDK this is failing for objects with only 2 points, so double check returned values. Finally, in order to see the control points in the new position, you have to reset the object. As James mentions, this could get you into trouble, as you could have an infinite loop. You either need to store old values and do a comparison, or use object states to only set values on creation or when another parameter has changed.
  8. Usually the display is the reference point for fixture orientation, which is what the red box indicates. The data ports are usually on the same side as well. A red box isn’t an industry standard per se, but finding a graphical way to call out fixtures that need data and indicate their orientation is best practice.
  9. In general: eval() will turn a string into a non-string: real, integer, object, etc. repr() will turn a non-string into a string As you noticed in your example you can also be specific about how you're converting a string, but I find eval() usually does the trick.
  10. You can control how flipped text adjusts by adding or subtracting 0.02° to the text rotation to the legend. The text rotation is imperceptible. Your 2 and e fields swapping makes sense, as they maintain their relative relationship as the rotation changes. Choosing the Flip L/R option in the OIP should swap them on a per-unit basis.
  11. I think GetLocalizedPluginName() refers to plug-in object. I think the assumption is that you would not usually present the name of a randomly selected menu or tool to the user, unlike with PIO’s where you may need to process a user-selected object. For any calls you would use either the IID or the universal name. If you’re trying to get the localized name of a specific menu or tool, you can always get the resource string using the full path. For core menus, for example, just explore VectorWorks.vwr and find the file and resource ID of the tool or menu you want. This is even easier if the tool or menu is in your own .vwr
  12. I have a tool designed for this. After setting projector lensing and focus, you can view from the projector. https://www.benghiatlighting.com/software/products/pv-1
  13. The list browser is what's used in the Organization Dialog to show nested classes. The quick and dirty solution for this is not unlike @Miguel Barrera's solution: use a list box to display all folders, including a Top or Root option. Show all sub folders prepended with spaces. Use a second list box to the right with the contents of each older. Before resource manager pop-ups, this is how most of VW's symbol selection dialogs worked.
  14. ovDimStartOffsetInCurrUnits will get you the dimension length, if that's primary what you're looking at. Depending on how precisely you're trying to calculate, you could fetch a number of additional dimension object variables to reconstruct the size. Interestingly, I think in VS hLength() will work on dimensions, but I don't think there is an equivalent SDK command. You could see if ISDK::GetEndPoints() works
  15. I don't think so. You can add a class pulldown menu. You can also create a list browser with hierarchical rows.
  16. Forgive me if I'm over-explaining, but the your formatting is a little confusing, so I thought breaking down the handler might be of assistance. This is how I would format those statements: Case Item of SetupDialogC: AddChoices; 1: {ID of ok button} GetDialogEvents; 2: { ID of Cancel button } end; { Case } Item is generally the id of the item the user interacts with, but the dialog will also raise a setup id before the dialog displays and a set-down id after the dialog closes. Setup / Set-down are also where you might get / set any saved settings for dialog position or values. The case statement is just a condensed if/then syntax. In your code, if the dialog is in setup, run AddChoices. If the user clicks OK, (presumable) save dialog values to global variables. Do nothin if the user clicks cancel. Each response in the case statement does not need to be a separate procedure, though it can be if the code is more clear to you. Functionally, it is the same as Begin {procedure code} End;
  17. I can't quite follow your code. The way you're using GetEvents, SetupDialogC, and GetCodeDialog1Events seems wrong, but I can't tell without the actual code. This example has the full code structure for a dialog and includes a pulldown: http://developer.vectorworks.net/index.php/VS:CreateLayout
  18. You want it in your dialog handler, GetDialog1Results (which is a bit of a misleading name, as this procedure runs every time you have a dialog event). You generally initialize a pulldown in the SetupDialogC case, which is an event that runs before the dialog displays. Otherwise item will correspond to the selected control. You can also dynamically add and remove items during any event, for example if the selection of one pulldown affects another, like record / field.
  19. Looking at Sam’s code, Count('sel=true') should probably be Count((SEL=TRUE)) I might also start with setting numObjects := Count((SEL==TRUE)) and testing: IF numObjects > 0 THEN BEGIN Allocate....
  20. Possibly if you have Fundamentals it is not available, or the command may also be affected by using a localized version. It's definitely not a platform-specific issue.
  21. Untested PROCEDURE ExplodeSymbol; VAR Selection : HANDLE; arrSelH : dynarray[] OF handle; numObjects : integer; i :INTEGER; hPrev :HANDLE; {---------------------------------------------------------------------} FUNCTION AddToArr( h :HANDLE) : boolean; BEGIN numObjects := numObjects + 1; arrSelH[numObjects] := h; END; BEGIN ALLOCATE arrSelH[1..Count('sel=true')]; numObjects := 0; ForEachObjectInList( AddToArr, 2, 0, FSActLayer ); FOR i:=1 TO numObjects DO BEGIN if GetTypeN( arrSelH[i]) = 15 THEN BEGIN hPrev := PrevObj( arrSelH[i]); SymbolToGroup( arrSelH[i], 0); arrSelH[i] := NextObj(hPrev); END; if GetTypeN( arrSelH[i]) = 11 THEN begin HUngroup( arrSelH[i]); END; END; END; Run(ExplodeSymbol);
  22. Not to rain on your scripting parade, but command+k command+u? Applying the script to all selected objects adds a couple levels of complexity — not a lot, but beyond basic.
  23. It should work on both platforms. In fact, the screen shot in the link is Windows.
  24. The aux list contains additional VW objects that are attached to another object, including records and special groups. See this article on viewing the VW drawing structure: http://developer.vectorworks.net/index.php/SDK:Debugging_the_Vectorworks_file
  25. You can in Python, but not VS. Completely untested, but something like this should get you the group that represents the LS definition, and you can start to iterate over its geometry hLS = vs.GetObject('<LINE STYLE NAME>') if hLS: hAuxItem = hLS.aux kTypeGroup = 11 while ( vs.GetTypeN(hAuxItem) != kTypeGroup and vs.GetTypeN(hAuxItem) != 0): hAuxItem = vs.NextObj(hAuxItem) if ( vs.GetTypeN(hAuxItem) == kTypeGroup): hLSGeometry = vs.FInGroup(hAuxItem)
×
×
  • Create New...