Jump to content

JBenghiat

Member
  • Content count

    669
  • Joined

  • Last visited

Community Reputation

47 Great

About JBenghiat

  • Rank
    500 Club

Personal Information

  • Homepage
    www.benghiatlighting.com
  • Location
    NY, NY
  1. Dialog Builder 2018 Tools

    The db items are really all the same plug-in object type, you just change the dialog element type in object info. So, insert a Static Text object, then change the type.
  2. Question about selecting lighting units

    The Resource Manager is meant to be library agnostic. Being "in the library" for lighting instruments only means you are browsing the folder that happens to contain a lot of lighting symbols. What if you are looking to import a hatch that happens to be utilized by a lighting symbol? The Resource Manager allows you to do that. I don't think we want the Resource Manager automatically changing filters depending on what file we are browsing, as any file can contain any resource type. In contrast, if you use the Resource dropdown for the Lighting Instrument Tool, then that IS set to show only symbols. Similarly, if you are browsing for a hatch in the attributes palette, that is set to only show hatches.
  3. Do find objects on multiple layers, look through all the document layers, check if it is visible, and run the FindObj routine I haven't recently experienced issues with the origin shift, but if you do, you can retrieve the origin offset and shift the pick point. Not sure about the arc issue, though the developer notes indicate that it should work for arcs. Are you explicitly dining arcs? If so, you can always loop through all the arc objects and see if the distance from a given point is less than or equal to a given radius.
  4. Question about selecting lighting units

    I assume you are referring to finding symbols in the Resource Manager. While many library files contain only one type of resource (like the ones for hatches), your active file usually contains many kinds of resources, which makes the filter useful. Even the instrument library files contain symbols, record formats, and textures, so using the filter might have an application there. Tools that employ the pop-up Resource Manager, like the Lighting Device insertion tool (in the mode bar) or the attributes palette will automatically apply various filters so you only see the applicable resources. The general Resource Manager is designer to do more than just browse libraries, so there are many view options. The Resource Manager should be set to show all resources by default, not just hatches. If it did seem to be set that way when you first started using 2018, that would definitely be a bug.
  5. There seems to be something wrong with your test symbol — possibly some bad values got in there during testing. If you build the symbol again and run the script, it seems to work as expected. I am seeing a bug with nested symbols with drop shadows, where view changes cause it to render incorrectly.
  6. I haven’t looked yet, so this is a total stab in the dark. Are you adding ResetObject() to reset the symbol (pass a handle to the symbol definition and the inner symbol instance)?
  7. Next Object in Selection

    Well, you do know ther’s an existing plug-in that will create almost exactly what you want from a worksheet, right? You ultimately probably want one of two things — step through the selected objects and have VW present a dialog where you can enter a y value, or read a series of values and have VW modify or even create the symbols based on the values. The former is fairly simple. The latter is definitely possible, but then you are starting to reinvent the wheel...
  8. How to add static texts to OIP?

    Use the TransferValue(SShapePaneWidgetTransferValue& data) method of IProviderShapePane. For each widget where you want to set a value: if ( fWidgetsProvider->GetWidgetByIDSafe( <Widget ID> ).fWidgetID == data.fWidgetID ) data.fWidgetAccess->Set...
  9. Next Object in Selection

    There’s no reason to move objects to their own layer. All the list traversal commands have versions for selected objects: FSActLayer, NextSObj, etc. I think the idea here might be if all you wanted from your script is to have a keyboard shortcut to select the next object. I also recommend using ForEachObjectInLayer as an easy way to work on a list of objects. If you’re new to scripting, I also recommend using python rather than learning native VectorScript. A simple handler looks something like this: def DoChange( h ): # insert code to modify the object h here return False vs.ForEachObjectInList( DoChange, 2, 0, 0 ) Though looking at your original post, if you’re manually entering data as opposed to entering data via the script, Pat’s suggestion of a worksheet might be the way to go. Alternatively, you can use the four buttons at the top-right of object info to affect each object in the selection individually instead of as a group. You can then step through the selection one at a time. Not quite as convenient as a keyboard shortcut but easier than clicking in the drawing.
  10. Next Object in Selection

    Go to developer.vectorworks.net for documentation of the API. You probably want to look at the ForEachObject... routines, which can iterate over selected objects. FYI, a handle is a unique address for an object that you can use to gain access to a ccess to it. Vectorworks assigns handles per session, so your script always needs to retrieve an object’s handle in order to start manipulating the object. For example, vs.FSActLayer() returns a handle to the first selected object in the active layer.
  11. Label Legend position bug

    You have your understanding of the non-rotating setting a bit backwards. What this setting means, is that the LL should always be in the same relationship to the light no matter what the light's orientation is. (Looking at your examples, though, you may not have actually set the legend to non-rotating. That WOULD be the solution for the units on the straight truss.) What you want is to have the LL itself be rotating but to mark all the fields as right-reading, which means that the text will always rotate so it is horizontal. Your label legend for the fixture at 6:00 is the easiest to configure. As you may have found with trial and error, what you want is for the entire block to be right reading, but because each individual label rotates about its insertion point, the text blocks no longer line up. Other than solving this with a script that tweaks label legend locations, you'll need three more label legends. First, set all the legend text to have a center / center insertion point. Duplicate the label legend three times. You can do this in the resource browser. You'll need one for 30, 60, and 90 degrees from vertical. For each of the new legends, group the legends and container and rotate in the opposite direction of the legend designation (rotate around the center of the group, not the origin of the instrument / legend). You should now be able to use the Flip options in each Lighting Devices Object Info to achieve all your orientations.
  12. Forcing OpenGL to refresh

    Do we have a way to force OpenGL to re-render? If I edit a texture, OpenGL is caching the old texture definition, even if I change the object's geometry. Editing one of the OpenGL settings is they only way to make the render update. Is there a way to flag the drawing as needing to re-render?
  13. Creating a bitmap texture

    Figured this one out: gSDK->EditShaderRecord() presents the above dialog if you pass a handle of an image shader. Using VWTextureObj and VWTextureShaderColorImageshImage, getting a handle to the shader record is fairly easy.
  14. Custom tool event sink doesn't seem to be loading

    Ok, figured this out, sort of. In trying to resolve, I disconnected the tool from the plug-in object, but was still getting PIO insertion options in the mode bar. This was a clue that the tool wasn’t loading from the current code. The first compiles if the tool used the default handler, so I had to remove and re-add it to the workspace. Appearantly, workspaces save a fair amount of the tool definition, so in order for the tool to be flagged with a custom UI I needed to remove it completely, and the implementation definition runs as part of the workspace process and not on each session. I had removed and re-added as part of previous attempts to get this to work, but I may have done so in conjunction with setting other options incorrectly. So the moral of the story is: when developing a custom tool and making significant changes to either the definition or implementation, remove and re-add to the workspace.
  15. How to set a pluginObject to transparent

    Are you selecting objects manually or as part of a tool. If manual, you can always hold down the B key to enter into X-Ray mode, a temporary wireframe. You can also turn off occluded selection in 3D preferences. If you are coding the selection process, you can toggle the preference via code. 3D transparency is accomplished with textures, usually best if you want something to appear translucent. If you want the object to behave as if it were not a solid, I would create it with NURBS outlines rather than as an extrude. (Leave the NURBS as curves — do not combine or loft them into a surface). That will give you snappable, unfilled 3D geometry.

 

    • 7150 Riverwood Drive
    • Columbia, Maryland 21046, USA
    • Contact Us | 410.290.5114

 

  • © 2018 Vectorworks, Inc. All rights reserved.
  • Vectorworks, Inc. is part of the Nemetschek Group.
×