Jump to content

JBenghiat

Member
  • Posts

    2,028
  • Joined

  • Last visited

Posts posted by JBenghiat

  1. @DomC thanks for the further information. 
     

    I think you have two possibilities— either your script is not resetting the object, or the “update” button does more than just trigger the regenerate event. 
     

    Generally, calling ResetObject() won’t actually trigger the reset event until after your script completes, so for example, if setting parameter a affects parameter b, calling:

    SetRField(a)

    ResetObj()

    GetRField(b)

     

    will return a value of b as if a had not changed (because it hasn’t yet). 
     

    If this is your scenario, and the cabinet object is SDK based, which I believe it is, you can use 

    ovParametricImmediateReset                    = 1167

    on the PIO to force the reset before continuing on your script. 
     

    If the cabinet has parameters that depend on each other, for example a change an affects b and changing b affects a, the PIO likely detects OIP changes and responds accordingly. As far as I know, there’s no way to trigger a parameter change as though it was made by the user. SetRField() directly changes the object’s parameters without triggering any state change events. 
     

    In that case, I recommend contacting the interiorcad folks and seeing if they can provide a specific solution. 

    • Like 1
  2. You can trigger the reset event via ResetObject(). You can use states to see if the reset was internal (e.g. changing a parameter or moving) or triggered by the call. You can also use the string repository to pass information to the PIO
    In terms of triaging a button event or the tool, if the event is from another one of your scripts, you can structure you code to run from the same includes. For example, construct an include file that takes a handle to your PIO as a parameter. Pressing a button on the PIO would pass the PIO’s handle to the function. Running a menu command would invoke ForEachObject() with your function as the callback. 

  3. Text in viewports, symbols, and plug-in objects will auto-rotate to all face the same 90 orientation when Adjust Flipped Text is turned on. As a workaround, you can add or subtract .02° to the orientation to maintain control over which way the text faces (that's just enough virtual thumb on the scale to tell VW which way is down). The rotation is imperceptible -- even if you zoom way in, there's no visible distance to an orthogonal orientation.

    • Like 4
  4. I'll also plug my Savvy Position Label. One of the options for the Notes field is a display of total hung weight for the position, which includes every object attached to the rigging object as a load. It works with Hanging Positions, Lighting Pipes and Ladders, Straight Truss, Curved Truss, Truss objects, Truss lines, and Truss systems. The result only appears as a note in the positions label -- if you need a report, AutoPlot is the way to go.

    https://benghiatlighting.com/software/product/position-label/

    • Like 1
  5. On 5/3/2023 at 2:44 AM, twk said:

    @tbexon, you're a genius, I kept crashing previously, regardless of the developer mode on or off. The only thing that was missing from my code, was the reset object_hand call.

     

    Also, what is happening here:

        if theEvent == tb.Constants.kObjXPropPreference:
            defaultVals = {} # Creates blank Dict for default vals
            MakePropertiesDialog()

     

    don't think I've ever use the kObjXPropPreference constant in my plugins

    This is the event raised when VW requests a preferences/settings dialog for the PIO. By default, this is basically just a floating version of ObjInfo, but if you set

     

    ok = vs.SetObjPropVS(tb.Constants.kObjXPropPreference, True) # Allows for creation of custom OIP

     

    You can handle the event and show a custom dialog. The Door, Window, and Data Tag insertion tools are all an example of this.

    • Like 2
  6. I'm curious if anyone has experience working with kObjXPropHybridSupports3DTransforms enabled.

     

    I essentially have two questions:

    Is there any difference between handling moves and rotations in UpdateSupport as state events verses overriding OnModifyObjectCommand? If using OnModifyObjectCommand, does that mean the code doesn't have to first reverse the transformation and then handle accordingly?

     

    How does one decode the transformation type from the transformation matrix? Is it as easy as calling VWTransformationMatrix::GetAngles? If a mirror was performed, how so we determine the location and orientation of the mirror plane? 

     

  7. 34 minutes ago, DomC said:
    ok = vs.ws2CreateTool(path_new_tool, "Blindfold", 3) #Don't know what this index 3 is used for

    I believe this is the problem. Here are the constant values I have noted:

    kSDKTool = 1
    kVectorScriptTool = 2
    kVectorScriptObject = 3 kSDKParametric = 4

    • Like 1
  8. Unique names affect more than just the class list.

     

    The name list includes resources, classes, and names assigned to objects. For example, if you have a symbol named "Astera AX5," you can't also have a class with the same name. I believe layers is the only object type that doesn't share the name list, but there may be a few others.

     

    Generally, any time you create a named object, you should check to see if the name already exists. Checking if vs.Name2Index() > 0 is a good way to confirm the existing name.

    • Like 2
  9. I believe collapsible sections are enabled by default, but if not the hookInf file in the SDK will give you the object property to set. 
     

    All you need to do is add a separator widget for each section, then indent all the widgets in that section by at least one. 

  10. I think I might have a different solution.

     

    In the move state event, if the object has been dragged, gSDK->ClickDragToolStatus() returns kToolCompleted, otherwise, it returns kToolWaitingForFirstPoint.

     

    ISDK::GetToolPtCurrent3D() seems to be correctly returning the coordinates of the mouse-up, which then lets you calculate the transformation offset and ignore ObjectStateData_Position::fTransformOffset.

  11. I’ve successfully implemented contextual menu items for a number of objects, but they only work when a single object is selected. I thought this was a limitation of Vectorworks, but I’m noticing that some other objects add contextual menu items when all the selected objects are the same type. 
     

    Does anyone know how to accomplish this?

  12. Ah yes, I misread the directions of the offsets. The drop shadow attribute would only work if the façade were a single polygon with holes. For example, use the inner boundary mode of the polygon tool to create the shape, then apply the drop shadow. So possible, but a bit cumbersome. 

  13. While I fully support exploring scripting solutions, it's worth noting you can do this with Drop Shadows in attributes. The offset is in page units. You can set these to be class defaults, and just assign the class to all the objects that you want to have the shadow.

    image.png.0e9c3bf6d35a5be82066af9dfa67b542.png

  14. The Series 3 in the library looks like mostly a data update. The size and shape of the units changed pretty considerably, if that's important to you. Here's a comparison of the 36-degree symbols:

    image.png.6c5b2a955214fcf49fcf258789e4532a.png

     

    Also, just to add some complexity to developing symbols, the Series 3 engine also works with the older gate assemblies and both standard and EDLT lens tubes, though the newer gate assembly and XDLT lens tubes are standard.

    • Like 2
  15. The symbol should show whatever the default record values are for linked text, and you can access the record attached to the symbol definition. You can either read the field values, store them, change to display values, then restore, or you can cope the symbol definition just for display purposes, then delete. You may have to do a ResetObject() after changing the field values. 
     

    You can definitely edit a symbol definition via script, but if you want to change the text format in just the one symbol instance, then no, the linked text follows the same rules as any other part of the symbol. If you want each instance to be different, you’ll need to create a plug-in object. 

  16. Is there a way to figure out when dragging an object is complete, and get the location of where the user released the mouse?

     

    On first review, the only way I can see to do this is store the cursor location during OnDrag() to a static variable, and then on object move check if that variable has data -- but that seems a little tedious.

  17. 14 hours ago, Tom W. said:

    But you need to have a 'dummy' Light in the drawing in order to turn off the Ambient Light right...?

     

    Good point. You need to insert at least one light, and it can be off, if you want to turn off the default light.

     

    14 hours ago, Tom W. said:

    Also, Glow doesn't seem to work in Final Quality RW + Fast RW??

     

    It should. If you're not seeing the glow emit light, see my note above about bounces. In Lighting Options, you won't see the glow if Indirect Lighting is set to None. You need at least one bounce.

  18. You need to apply a texture to the object with a glow reflectivity.

    You can create a new Renderworks Texture in the Resource Manager, and then edit it.

    Under Reflectivity, select Glow. 

    In the Glow options, enable Emit light.

    Apply the texture in the Render tab of Object Info, by dragging the texture to the object, or using the Texture Tool.

     

    You do not need any additional lights for the glow, but you do need to be in wither Renderworks or Redshift, and you need your Lighting Options set to at least one bounce.

    • Like 3
×
×
  • Create New...