Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by JBenghiat

  1. I'm seeing similar behavior. Looks like a Vectorworks bug. Being event-based shouldn't come into play. If you're code isn't structured to handle events, this should be off.
  2. You can use RunTempTool to draw objects during the mouse move event. With vs, you probably can't easily draw a representation of the objects you are moving, but you should be able to draw the bounding box fairly easily. The example in the wiki includes draw commands. https://developer.vectorworks.net/index.php/VS:RunTempTool Keep in mind that if you're running as a tool, the entire script begins executing at the moment of the first click.
  3. When in the process are you wanting to draw the preview? You have some limited drawing capacity with event enabled tools, as well as with RunTempTool, but this is generally not something you can do with Vectorscript.
  4. You can force an object to reset immediately by setting its object variable 1167 to true. However, I believe this only works if the object is SDK based, and I’m not sure about the stage decks. In this specific case, you could always reverse engineer what the stage deck is doing and calculate your 3D points based on the stage deck’s parameters and location.
  5. What data are you updating? Some parameters are actually calculated from other data, so you can't set them explicitly. Also, you should call ResetObject() from the script.
  6. Are you looking to export data based on a manual menu command? If you're not looking to have the data exchange based on automatic triggers, you may want to try scripting with Python instead of the SDK. If you're new to the VW file structure and want to check your work with frequent console-like feedback, you'll find the process much easier. Plus, you have the added benefit of not having to wait for your new code to compile and VW to restart. If you are committed to the SDK, I recommend learning how to use the debugger and viewing console output that way. Pure testing requires you to mock object data, and your code seems to be looking to test data retrieval, which you can't really do with a pure test. Are you looking to retrieve information from Lighting Devices? A Lighting Device is a parametric object with the universal name "Lighting Device." That would be a kParametricNode, not a kLightNode, the latter giving you a render light object. My sense is your code is adding too many layers of complexity. Take a look at the VWParametricObj class. That will allow you both to test if the object is the desired PIO as well as retrieve parameter data the GetParam… calls. Use the "N" versions of ForEachObject… Those allow you to use lambdas, which is a much simpler way of exchanging data with the handler routine. They have the added benefit of allowing you to construct the handler routine in-line. The handler routines are designed to take one parameter of type MCObjectHandle. You want to process all drawing objects, unless you're confining your export to objects in a certain layer, only selected objects. etc. FYI, python also has ForEachObject routines. For Python, you would take advantage of GetRField( handleToPIO, 'Lighting Device', fieldToRetrieve) I suggest familiarizing yourself with the concept of handles, here and elsewhere Also take a look at the discussions on Debug List View, like this one. That will help you how Vectorworks structures its data.
  7. The standard build target isn’t an executable, so you’re not going to get any output when you build. Simple testing isn’t quite so straightforward. You can set up a separate target just for testing, but you have to make sure that vwmm is accessible as well as have a good sense for when you need to mock any data that comes from interacting with Vectorworks. You can also set your plug-in to generate test output within Vectorworks, but it needs to output to a log or dialog or use the VW testing interface. There’s not really such thing as a standard output.
  8. You have a few options, depending on what the workgroup folder is relative to. Note, some of the docs are out of date: the commands should all now take POSIX paths, not the old Mac notation. You can get relative paths via the ../ syntax, which could let you find the path anywhere on your system. It's been a while since I've used CopySymbol, so you may want to confirm that the path is still relative to the application folder and not the user folder. If you're on a Mac, you should be able to use ~/ as an absolute path from the user's home folder. You can also use GetFolderPath() and then use the various python path utilities to parse and build an absolute path to the workgroup folder. Finally, you can look at the BuildResourceList commands. Those should allow you to access resources in the Workgroup folder if they are filed correctly. If the workgroup folder is relative to your user folders, you can also possibly construct a relative path to pass as a subfolder.
  9. Yes, definitely possible. Use SetActSymbol() to set the active symbol definition. SetTool(-209) will activate the symbol insertion tool. You may want to check that your selected symbol is in the current document as well is import the symbols from a library file if they aren't. Otherwise, all you need is those two lines of code. If you're on the Mac and have a utility that can execute an AppleScript from your SteamDeck, you can use DoScript to call those commands directly. Otherwise, for each, you'll need to create a custom menu command for each symbol, add to your workspace, assign a keyboard shortcut to each, and then call with the SteamDeck.
  10. You're not going to find a lot of documentation, I'm afraid. Even the release notes haven't been updated in years. https://developer.Vectorworks.net has some useful tidbits, though, even for articles that are out of date. The best place to start is to look in the source/samples folder of the SDK. TesterModule will provide a basic framework for most plug-in types. EmptyModule is a good project to duplicate and modify from there. When the project is setup correctly, and you switch to the Property Manager tab of VS, you'll see a number of property sheets installed under the configuration: If you are in a debug config, RELEASE should be DEBUG. You can right-click on the build configuration and choose Properties… Anything that is overriding the property sheets will be in bold. I tend to get rid of any overrides here, and set them in my own property sheet so that I can include it in all projects. Here are the additional configuration settings from my property sheet: Compiled plug-ins will only work with the corresponding Vectorworks version, so I have a property sheet for each year where I define a version variable, and use that to modify both the output directory and the SDK include directories. General Output directory — customize this using macros so be an absolute path and unique for each yearly version Intermediate directory — similar, so rebuilding multiple versions is faster VC++ Directories Include Directories — I add: $(SolutionDir)Source\Prefix $(SolutionDir)Source C:\VWSDKWin2022\SDKLib\Include — I have a folder for each version's SDK that I'll copy the SDKLib into. This makes it easier to update when a new SDK build is released, as well as update my config files each year using a simple find and replace. I also add the path to any custom header libraries here C/C++ ASM List Location: $(IntDir) Basic Runtime Checks: Default Debug Information Format: ProgramDatabase (/Zi) Object File Name: $(IntDir) Optimization: Maximum Optimization (Favor Speed) (/O2) Precompiled Header: Use (/Yu) Precompiled Header File: StdAfx.h Preprocessor Definitions: __FP__;WIN64;<Inherit> Program Database File Name: $(IntDir) Runtime Library: Multi-threaded DLL (/MD) Security Check: Disable Security Check (/GS-) Smaller Type Check: No Treat WChar_t As Built in Type: Yes (/Zc:wchar_t) Warning Level: Level3 (/W3) Linker Additional Dependencies: VWSDK.lib;5(AdditionalDependencies) Additional Library Directories: {path_to_your_VWSDK_install}\SDKLib\LibWin\Release Generate Debug Info: No (For the release build) Build Events — This is what builds your Vectorworks resource .vwr file Command line: REM VWR Resource build script set VWR_INPUT=$(ProjectDir)$(TargetName).vwr set VWR_OUTPUT=$(TargetDir)$(TargetName).vwr set VWR_MODE=$(Configuration) set VWR_7ZCMD={path_to_your_VWSDK_install}\SDKLib\ToolsWin\BuildVWR\7z "{path_to_your_VWSDK_install}\SDKLib\ToolsWin\BuildVWR\buildvwr.exe" Debugging has its own complications, and the developer wiki has a guide. Note, for testing, VW will load shortcuts in Windows and aliases in MacOS for the user plug-ins folder, so you can just reference your built file and not worry about copying it for testing (and this is actually necessary for debugging). Note that you ask about both VS and Xcode. While you can do your primary development in one platform or the other, if you want to compile for cross-platform use, you must use the corresponding IDE for to build for each platform.
  11. 2021 made large changes to how accessories work, but it does not have these issues.
  12. Seems something went wrong with the encryption. https://support.esri.com/en/technical-article/000011731
  13. Is this a plot imported from a prior version? I’ve discovered all sorts of issues up converting plots with accessories, including both lights and accessories deleting or not drawing. I’ve found 2022 is basically unusable if the plot originated in an earlier version.
  14. Python/vs does not have a way to change tool defaults and the NURBS degree doesn’t appear to be something that’s a program preference. The option that gives you then most control would be to create a custom tool for acquiring the 3D points that define the path. In theory, the NURBS tool preference gets written to your user preferences, and you can try searching the xml file for the value. You can then access with Get/SetSavedSettings(). But your code isn’t going to run before you place your first object, so your users would have to run a command to set the settings before inserting the object for the first time.
  15. How are you creating the path? If it’s a 3D path object with the built-in creation tool, you have the same options in the mode bar. If you’re creating the path through some other means, CreateNurbsCurve() lets you set the degree.
  16. In the mode bar, click the icon all the way on the right. This gives you a dialog for entering the degree. https://app-help.vectorworks.net/2021/eng/index.htm#t=VW2021_Guide%2FShapes2%2FCreating_NURBS_curves.htm
  17. If you haven’t already, import the current Parts record from one of the Spotlight content library files. Every 3D element in the symbol should have a parts record attached and exactly one of the fields checked. The 3D locus goes at the intersection of the pan axis and the tilt axis. It also needs the Parts record attached and the Point field checked. You should have exactly one 3D locus.
  18. I think projection has too many variables for this to be a simple calculation. The quality of the lens and the size of the image source can both affect the calculation. Some of the illustrations here are helpful. https://en.wikipedia.org/wiki/Circle_of_confusion Certainly, the larger the image source, the grater range of focus you will have (there's a reason that Pani projectors use 15cm slides, and Kodak used 35mm…), and a longer throw with a narrower lens is going to have better depth of field. I would actually imagine that projecting onto a curved screen might have better depth of field than a flat screen, at least with a wider lens. The edges of the screen are actually at a more consistent throw then the center of the screen when the screen is curved. Projection lenses actually act to counteract the natural curvature of the image.
  19. No, this is really just a bug fix that addresses some parts of the 3D projector symbol that aren't transforming correctly. The current mimics what happens in Spotlight with Lighting Devices: adding a 3D transformation to the projector breaks the relationship to the 2D component, so it just becomes a symbol indicating where the projector installs in plan view. Certainly generating a Top/Plan view from the rotated 3D is something I can add to the wish list. I would likely include an option, so that the user can choose between a pre-defined 2D view of the symbol or rendering the 2D from the manipulated 3D. I recently came across a bookmark I saved for Millumin https://www.millumin.com/v4/index.php Vectorworks plug-in for something like that could have potential.
  20. No, this is really just a bug fix that addresses some parts of the 3D projector symbol that aren't transforming correctly. The current mimics what happens in Spotlight with Lighting Devices: adding a 3D transformation to the projector breaks the relationship to the 2D component, so it just becomes a symbol indicating where the projector installs in plan view. Certainly generating a Top/Plan view from the rotated 3D is something I can add to the wish list. I would likely include an option, so that the user can choose between a pre-defined 2D view of the symbol or rendering the 2D from the manipulated 3D.
  21. The process is not particularly easy, especially if you're not already familiar with compiling applications with Xcode or Visual Studio. It's probably not worth while if the automation is for a single user. You can, in theory, call a python script from an SDK plug-in, though once you have it figured out coding directly with the SDK had a lot of advantages. Would you mind sharing more about what exactly you would like to automate? That could help us direct you to another possible solution.
  22. Python is a runtime language, so you’re not able to have any sort of listeners that can respond to various events. An event enabled plug-in object is going to raise the WidgetPrep event when it’s selected, though it will also raise that event any time you change a parameter. You can develop an SDK module (using c++) that responds to selection changes.
  23. The tool has been around a while, but was enhanced significantly fairly recently, maybe 2020. I think your requests are all fairly valid and achievable. I'm not sure who would help explore those, but perhaps @Matt Panzer can help direct. As for the sheet layer views, that is all achievable via section viewports and setting the various crop, depth, and length parameters. The easiest way to see this is to set the clip cube to isolate a beam, and then right-click on a face of the clip cube and choose to create a section viewport. I'm not aware of a command that automatically creates views that isolate an object, but again, I think that's a fairly achievable request.
  24. Any 2D or 3D path-based object is going to use the polyline tool or the NURBS tool, respectively, to draw the path, and will respect the options in the more bar. For 2D, you can select the point vertex mode, and for 3D set the NURBS degree to 0. You can't force the mode. You could write a custom tool for placing the PIO that only draws polygons, though that adds a significant amount of complexity to your project.
  • Create New...