Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

105 Spectacular

About JBenghiat

  • Rank
    500 Club

Personal Information

  • Homepage
  • Location
    NY, NY

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Looks like no, script palettes have to be at the root.
  2. JBenghiat

    Length of Hanging Position

    Yes — iterate through the contained objects, determine the type, cumulatively add the object’s length field (the field name depends on the PIO type)
  3. JBenghiat

    Lighting instrument candlepower data field

    Peak Candella in will give you foot-candles out. Lumens takes into account both intensity and distribution, so isn't as applicable to a simple cone-spread calculation.
  4. JBenghiat

    set active a rectangle

    Three modifications that should help: Don’t forget the parentheses in vs.DSelectAll() Instead of using the arbitrary x to govern the loop, use: while OBJECTO != 0: This will both ensure the script loops through all objects and prevent error if the number of objects is less than 10. Technically, the check should be OBJECTO != vs.Handle(0) vs.GetObject() returns the handle to a named object and should take a string as its parameter. What you want is: vs.SetSelect(OBJECTO)
  5. JBenghiat

    Updating Plugin Pop-Up Choices

    If you’re just looking to modify parameter options, there’s not really a way to do this. If your script is event enabled, you can use the WidgetPrep event to fill menus based on code as opposed to the predefined list. In your case, you can read values from a file. If you’re not currently using event enabled scripts, you are opening a proverbial can of worms, but you can greatly expand your available functionality. I believe the archive has some posts to get you started.
  6. JBenghiat

    LED Striplight Question

    Are you looking to track in paperwork, incorporate in Renderworks Renderings, or do actual revisualization in Vision or other pre-viz software (or all of the above)?
  7. JBenghiat

    Temporary symbol for tool action

    I want to have an interaction somewhat like the protractor in the rotate tool, where the user sets the insertion and rotation of a reference object. Has anyone done something similar? One thought is to create s temporary symbol and call the symbol insertion tool, but I don’t want the user options available in the mode bar. The other thought would be to create a plug-in object and accompanying tool for the sole purpose of inserting the reference object, but that seemed like a lot of extra code. Is there a Draw() function that can draw a symbol preview for a tool?
  8. JBenghiat

    Accessing and Creating Resource Folders

    SetPsrent() should work, and I believe you can get a handle to the folder with GetObject(). If you do an error check, the folder type will always be 92, regardless of content.
  9. JBenghiat

    Accessing and Creating Resource Folders

    BeginFolderN(), passing the object type of the resource. 16 symbol, 66 hatch, etc.
  10. JBenghiat

    Color of a CHAR in Text Block

    I can’t say I’ve ever needed to set color on a character by character basis, but I’m not aware of a method. You can set the color of an entire text block by setting the pen color.
  11. You can picture the Vectorworks document like an xml tree, where layers are parents of objects, if one of those objects is a group, it is a parent of its child objects, etc. HMoveForwards/Backwards will move anything up and down the tree at its level, so moving layers changes the layer order and moving objects changes the stacking order within the layer. VS doesn’t include a function for moving an object to a particular point in the list. If you want to insert a layer at a particular point, get a handle to the active layer, create the new layer, send it to the bottom, then start a while loop that moves the layer up until PrevObj(hNewLayer) (or NextObj() depending if you want above or below) = hActLayer.
  12. JBenghiat

    Associations equivalent in C++

    You can add an association with Kludge. I couldn't find a way to remove an association, so I call VS. // ------------------------------------------------------------------------------------------------------ void AddDeleteAssociation(MCObjectHandle FromObject, MCObjectHandle ToObject) { PluginLibraryArgTable argTable; argTable.args[0].argType = kHandleArgType; argTable.args[0].handleValue = FromObject; argTable.args[1].argType = kIntegerArgType; argTable.args[1].intValue = 4; argTable.args[2].argType = kHandleArgType; argTable.args[2].handleValue = ToObject; EPE_Kludge in( EPE_Kludge::kKludgeAddAssociation, & argTable ); ::GS_Kludge( gCBP, EPE_Kludge::kKludgeSelector, & in, nil ) && argTable.functionResult.boolValue;; } void RemoveDeleteAssociation(MCObjectHandle FromObject, MCObjectHandle ToObject) { PluginLibraryArgTable argTable; argTable.args[0].argType = kHandleArgType; argTable.args[0].handleValue = ToObject; argTable.args[1].argType = kIntegerArgType; argTable.args[1].intValue = 4; argTable.args[2].argType = kHandleArgType; argTable.args[2].handleValue = FromObject; gSDK->CallPluginLibrary("RemoveAssociation", &argTable, 0); } // ------------------------------------------------------------------------------------------------------ If you want to handle deletions on the event level, look at the UpdateSupport example in the SDK. The update manager runs independently of the plug-in objects, so it can handle deletions.
  13. Selection status is actually like a flag that saves with the object, so selection maintains even if an object isn't selected and editable. You may notice that objects on inactive layers stay selected when you switch back to the layer (if you haven't done a DSelectAll). Running the criteria will give you ALL selected objects. This should work: Locus(0,0); waldo = LNewObj; hSelected = PrevSObj(waldo); IF (waldo <> nil) THEN DelObject(waldo);
  14. If you're just trying to get the class of the selected object, where's Waldo is probably going to be your best strategy here. Duplicating the object doesn't really help you — it's getting a handle to the selected object that's tricky, not getting info about an object in a group. Just one thing to point out here: this is true once you get the handle to the selected object you want. If MyObject = FSActLayer, by definition, the parent is always going to be a layer.
  15. FSActLayer literally does what it says, even though we may think of it as the selected object: only returns the first selected object of the active layer, no matter where you may be in the object tree. The Waldo method is the best option for VS. You can get the type of waldo’s parent to know if you are in a group (or group-like object, like annotations). When you create an object, it’s selected, along with the previously selected objects, so PrevSObj(hWaldo) will give you the selected object in whatever container you may be in (layer, group, symbol definition, etc.). If you know you’re in a group, you can use FInGroup, FIn3D, etc. to get the first object, and then loop through selected objects until you find the last one.


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.