Jump to content

JBenghiat

Member
  • Posts

    2,030
  • Joined

  • Last visited

Everything posted by JBenghiat

  1. Are you always placing symbols? If so, rather than duplicating, you can just place the symbols with offset insertion points. Either way, you want nested sets of for loops: for row := 1 to rows do BEGIN for column := 1 to columns do BEGIN END END Pay attention to whether your index is 1-based or zero-based, depending on if you're inserting or duplicating. If you're duplicating, the columns loop would use ledFrameDup instead of ledFrame as the object you're duplicating. P.S. Take a look at surface arrays. That may already accomplish what you are trying to achieve.
  2. VS doesn't have a way to get or set widget values, so any widgets that hold data need to be connected to an existing parameter. i.e. use vsoAddParamWidget() and vsoInsertParamWidget(). The popup parameter would already be in place via the Plug-in Manager interface. While you can use the vsoWidgetPopup commands in the widget prep event to manage the choices in the popup, you would still get and set values with Get/SetRField or vs.ParamName (the latter being read-only). Storage-wise, a popup is just a text field.
  3. For the moment, Shaded render replicates OpenGL, so shader shadows are bitmap (B&W) and reversed (black is allows light to pass).
  4. What sort of files are you trying to remove? The first thing would be to check permissions in the user folder in explorer. If you’re removing compiled plug-ins or vwr files, Windows keeps those loaded while Vectorworks is open, so you can’t delete them. You can move them to a trash folder outside of plug-ins. That way they won’t load, and you can cleanup on the next script run. One option would be to build a partner products installer and distribute it using the developer testing procedure. You would need to copy your installer into the user plug-in data folder. The partner installer moves files as Vectorworks is quitting to get around these issues.
  5. I have yet to purchase a machine that has the new chips, so when one of my users reported that plug-ins weren't loading, getting the build sorted took some trial and error. Here is what I discovered: *Code Signing* I'm still not 100% certain if code signing is required, but I do know that the wrong signing settings can cause plug-ins not to load. Using the Apple Development signing certificate does seem to work. Code signing is also picky about finder attributes making their way into the bundle, and the current build-vwr step does not currently strip them out. While there is a command you can add to the script for this, an even easier solution is a new option in Build Settings to Copy Bundle Resources. Simply select your .vwr folder, and the build process will take care of properly moving them into the plug-in. Then you can remove the build-vwr script entirely. *SDK Version* Somewhere during the beta or SP process, the .xcconfig files in the SDK changed. Make sure you're using a later version (at least SP0 release, but possible SP1 is needed), as some of the settings configure the compiler to build for both intel and silicone architecture. *Check Customized Build Settings* Check your customized build settings and clear out any custom settings referring to the OS or SDK. I had a few overrides that were preventing things from compiling correctly. *Update the Deployment Target to 10.13* Previously, it was 10.12 *Set the Scheme to Any Mac* This was one of the big ones. Under the current scheme, change the option from My Mac to Any Mac(Apple Silicon, Intel). If Any Mac does not have both options, go back to your Build Settings, and check for incorrect values. *Clear out your Frameworks* In the Project Navigator, view the Frameworks, and delete any copies of VWMM.framework. Next in the Target>General settings, add a new framework, and navigate to the v27 VWMM. Set embed to "do not embed". For me, simply adding the latest framework here didn't work. I had to delete the existing frameworks and add the new one. At this point, compilation was successful, as was loading on the Apple Silicon machine. I assume that if you're compiling on a Silicone system, you need to take similar steps to endure that the plug-in library will run on an intel system.
  6. Or if I’m understanding correctly, GetSymRot, and subtract that from the desired rotation value you pass to HRotate
  7. Most of them are here: https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#appx_f though a more thorough list of preference and object selectors can be found in the SDK. Constant values are the same between the SDK and vectorscript.
  8. SetPrefReal( 89, {DISTANCE} ); Note, the distance may need to be in millimeters
  9. I think you're confusing Ungroup with Convert to Group. You want the latter method. In vs, use SymbolToGroup. Looking at the function reference, getting a handle to the group is a bit complicated. See the example in the reference, though you may want to search the forum for the "waldo" method. Note, using a PIO in this way has other complications. You're getting the default parameter settings for the wide flange, which may change over the course of the drawing, and this be unpredictable. You can set the parameters of the flange with SetRField, and then reset the PIO, but the reset only happens after your code runs, unless the flange is an SDK-based PIO, and and you set it's object variable 1167 to true. Possibly, setting the object's defaults before inserting will work.
  10. If you compare time and money spent at the repair shop… your analogy still holds 🙂
  11. I concur. The variable types in vs and python are good about self-initializing. In fact, my preferred way to check for a null handle in python is to compare to vs.Handle(0). So extra tricky for those of us crossing over to c++.
  12. Does anyone have any examples or insights for using TImportResourceConflictCallbackProcPtr? The issue I'm having is when I import a symbol that contain's a class name that conflicts with a non-class (like a symbol that has the same name as the class). I want the imported symbol to replace an existing symbol, but I want the incoming class to rename silently.
  13. look at the ovSheet… object variables. Looks like before sheet layers existed, saved views were called "sheets" internally.
  14. I discovered that handles need to always be initialized if not immediately assigned to a return value. For example: MCObjectHandle hObject; Will not evaluate to null, nullptr, or false. You have to use: MCObjectHandle hObject = nullptr; or the equivalent class initialization. This may be obvious to most, but until I realized this, some null checks were failing.
  15. A few things to consider: - The text is gong to create using the default text settings, so it may or may not wrap before you tell it to. - You also need to set the width of the object, otherwise there's not a universal way of determining the wrap (it's not like text wraps to the page boundary). - You may find that CreateText() is more reliable, both because of the default formatting coming into play and because you have to take into account line breaks and other special characters in the code itself.
  16. @Mark Aceto Specifically for ProjectionViz, in Settings, accessible at the bottom of Object Info, you can choose how the object behaves when duplicated. You can maintain the location of the projector, focus, or neither. I'm seeing a bug when mirroring the projector, where the two lock modes do not work as expected. If you select Neither, however, you can simply use the mirror tool (or duplicate array).
  17. The description explains the sorting: The first value is the length of the array. If this is a dynamic array, then you should be tracking the size of the array anyway. The second is the index of your data structure, if you have one. If the array contains handles to record instances, pass the field index that you want to sort by. I can't recall if this also works on PIO's. While vs allows you to access data via the PIO handle, it's technically not a record. If it does work, you can use the Plug-in manager or DebugListView to find the field index. I believe the index is 1-based/ Alternatively, you can sort an array of structures (see the vs language guide). You then pass on which element of the struct you want to sort, based on the order of fields in your structure. This is probably a better approach, as you don't have to rely on the index of the field — you can use GetRField to retrieve the data and store it into your structure. You can also concatenate data in order to create a primary and a secondary sort. Sorting data in vs is definitely clunky, and with Python as an alternative, not likely to ever improve.
  18. If the plug-in has its own version control, you can hook the kNotifyPlugInObjectUpdate notification in update support. But that requires you to check the plug-in instance to determine if it needs upgrading, for example a version field or the absence of data that gets auto-filled on first run. You can also use IProviderSaveCleaner to trigger actions just before save, though I believe this is more geared towards reverse translation than forwards translation. I have not tested either of these with the batch conversion process.
  19. There is a migration interface. I haven’t implemented it, so I don’t know is you can easily find it in the SDK — I know I have it in an email somewhere. You can also either call the file up-convert interface or listen for the plug-in update event — I presume handling would be the same whether called for an individual file or a batch convert.
  20. Hmm... I definitely want it to receive shadows from other objects. Is this because the image textures seem to be sort of like gobo textures? The projection cone is a 3D object and separate from the projected image. Now that i'm back at my computer, the texture for the cone is already set not to receive shadows. You'll only see this on RW, though. You can always turn off the projection cone in Display options, or in Rendering options toggle Only show image plane. This is, of course, in addition to the option of applying a class to the projector cone and controlling that way.
  21. Yes, there’s a manual section on this. Adjust the interaction locks to control how drags and move commands function. Locking the length of heights, and then either the location of projector or focus, will only move the unlocked location. For example, if the projector location is locked, a move of x=3 would move your image 3’ to the right. Locking throw or plan distance will move both the image and the projector. Dragging a control point in 2D or 3D will move just that point, regardless of locks. You can use the Lens to hanging point option to enter the z distance from the lens center to the insertion point. You will have to adjust the symbol for L/R. Note Vectorworks does not include a way to universally indicate the lens center in a projector symbol That’s not currently possible. I’d have to look at the math involved, and basically it would turn the image upside down. The workaround would be to duplicate your symbol so the snorkel faces up. Edit the projector beam texture and uncheck Receive shadows. I guess it’s somewhere in the middle. You have to add the text you want to the label, but you don’t have to deal with any layout. It would actually be way too complicated to allow simple text box toggles as well as custom prefix, suffix, and label order. A single text box for all of this is actually much simpler. This is a limit of OpenGL itself. Now that GL is becoming deprecated, there’s a chance this could improve in the future.
  22. My guess is that the Render Bitmap tool is not using Redshift.
  23. Light will pass through objects with transparency, like glass, but they do not recognize shadow mapping. Redshift requires shadow-casting shaders to apply directly to lights, which isn’t something light objects in Vectorworks have ever been equipped for, so it’s not so much hobbled as not implemented yet.
×
×
  • Create New...