Jump to content

twk

Member
  • Content Count

    632
  • Joined

  • Last visited

Everything posted by twk

  1. twk

    Roofing

    Set a class to the roof object. And control the fill/pen attributes (colors) through that. Once it is classed, you can also then set this new roof class you've created to gray visibility when you're in plan view, and then set visibility back to visible when in 3D view.
  2. =('VAA Title Block'.'__DwgScale') __DwgScale is the field you're looking for
  3. wow, I did not know this. Very similar to the script I have. Apart from not being able to pre-select scaling conditions:
  4. +1 to have the Titleblock do this automatically, even for the numerical scale part of the titleblock. I wrote a script that automatically fills in scale info from viewports at time of publishing. In instances where we have you multiple viewports with different scales on the same sheet, you preset what you want the script behavior to be (largest scale/smallest scale of collected viewports on sheet, or concatenate scales, or display 'as shown'). It makes sense that a functionality should be added into the titleblock object, as it is such a pain publishing your 100 page set, then realising scales were not set correctly. (That's what happened to us, and that's why the script was written 😁)
  5. Hmm, yes that is what I'm currently doing, importing then deleting. I thought there was a different way. Thanks for the insight. I'm looking at the build resource list calls, in what use case would the addResoureceToList function call be used for? Is it just a container mechanism for VS? The same functionality can be done using lists in python correct?
  6. Greetings, I'm trying to read default record field values from another file using the BuildResourceListN function: def vs.BuildResourceListN(type, fullPath): return (LONGINT, numItems) I manage to read in the record names from the other file, however using the GetResourceFromList function returns NIL on resource handles. And, as the dev wiki documentation describes, this will return NIL if resource is not in document. Is there another function call I'm missing? or is this not possible. I see that the titleblock tool can open and display issue data from another file. How is it doing this? @JBenghiat, @Vlado, anyone? Thanks in advance
  7. Maybe create a temporary symbol > add all other symbols in there > place on drawing > export as image > delete temporary symbol
  8. To add to this discussion, we have found that unchecking 'subset fonts' reduces the file size quite a lot. Approx. file size reductions i'd say 8Mb to 200kb.
  9. Possibly the level of error checking in Visual Studio? I use PyCharm and have not much experience in VS. Pycharm recommends the h is not None flavor. Using the h != None, displays a warning to adjust my code.
  10. Ahh yes, that would be me, I forgot I had even signed up as a contributor.
  11. @_c_ this is nothing short of amazing. Truly, thank you for reviving this! Happy New Year from the southern hemisphere!
  12. Interesting, crashes on me every time, even as a standalone script as you've shown. Are you on Mac? It must be a Windows specific thing.
  13. Yep, all simple strings in my testing, I shall submit a bug. Do you use ListBrowsers in your plugins @JBenghiat? Have you ported to 2021 yet? All my plugins work and the only ones crashing were the ones with this function in them. Commenting it out solved the issue, but there wasn't anyother way for me to get a proper width value for setting column widths from text strings. I've had to resort to hard coding guessed string lengths for now.
  14. vs.GetLBHeaderTextWidth(className, allowForSortIcon) The function above is crashing my VW 2021. Anyone else can confirm before I try a reinstall/bug submission? It gets pixel width for specified string (param:className for some reason??) for use with Dialog ListBrowsers.. Cheers, Tui
  15. twk

    2021 Public Roadmap

    @M5d, very well collated a very good read. Gotta love company politics 😅 I personally don't have a dog in this fight, as I use Lumion, however it was very telling when the EpicGames roadmap was released and no vectorworks integration was even mentioned.
  16. twk

    2021 Public Roadmap

    I thought that sentence was going to end better.. Ha!. On topic though, these are much welcomed discussions by VW. Even though I agree, the Architecture tools that are under research need to be released as soon as, I am happy to know VW is listening and providing users an opportunity to have a look at the drawing board and hopefully assist in steering development that benefits us all.
  17. I understand normal hotmail accounts have free one drive storage. So you would sign into onedrive on your PC/Mac with your free account and sync as needed. Similar to dropbox I believe. We are on office365 here, but I know others with free accounts we can send links to and have folders sync'd between us
  18. No expert, but doesn't each VW object have a UUID? Could maybe the data tags that tag the external ref objects, store these? Watching this thread fervently, as data tagging of DLVP and ref DLVP objects is much needed in our practice as well. (eg, doing apartments/real estate development, you have floor plan types via DLVPs)
  19. fixed/tweaked your code: (minor errors in GetLBEventInfo call) import vs kLB001 = 4 kPB_Expand = 5 kPB_Collapse = 6 import vs def dialogHandler(item, data): if item == 12255: nCol = vs.InsertLBColumn(dialID, kLB001, 0, 'Item', 150) bResult = vs.SetLBControlType(dialID, kLB001, 0, 1) bResult = vs.SetLBItemDisplayType(dialID, kLB001, 0, 3) # Some Lines to fill the listbrowser nItem = vs.InsertLBItem(dialID, kLB001, 0, '2D-Axis') nItem = vs.InsertLBItem(dialID, kLB001, 1, '2D-Cap') nItem = vs.InsertLBItem(dialID, kLB001, 2, '2D-Housing-Back') nItem = vs.InsertLBItem(dialID, kLB001, 3, '2D-Housing-Frame') nItem = vs.InsertLBItem(dialID, kLB001, 4, '2D-Housing-Glass') nItem = vs.InsertLBItem(dialID, kLB001, 5, '2D-Leaf-Back') nItem = vs.InsertLBItem(dialID, kLB001, 6, '2D-Leaf-Frame') nItem = vs.InsertLBItem(dialID, kLB001, 7, '2D-Leaf-Glass') nItem = vs.InsertLBItem(dialID, kLB001, 8, '3D-Axis') nItem = vs.InsertLBItem(dialID, kLB001, 9, '3D-Cap') nItem = vs.InsertLBItem(dialID, kLB001, 10, '3D-Housing-Frame') nItem = vs.InsertLBItem(dialID, kLB001, 11, '3D-Housing-Glass') nItem = vs.InsertLBItem(dialID, kLB001, 12, '3D-Leaf-Frame') nItem = vs.InsertLBItem(dialID, kLB001, 13, '3D-Leaf-Glass') vs.EnableLBSorting(dialID, kLB001, False) vs.SetLBHierDispColumn(dialID, kLB001, 0) vs.EnableLBHierDisplay(dialID, kLB001, True) global numLBItems # has to be a global, otherwise it won't work... numLBItems = vs.GetNumLBItems(dialID, kLB001) elif item == kLB001: LBrecursive = True bResult, LBeventType, LBrowIndex, LBcolumIndex = vs.GetLBEventInfo(dialID, kLB001) if vs.HierLBItemIsClosed(dialID, kLB001, LBrowIndex): numbRedisplItems = vs.HierLBItemOpened(dialID, kLB001, LBrowIndex, False) else: vs.HierLBItemClosed(dialID, kLB001, LBrowIndex, False) elif item == kPB_Expand: for i in range(numLBItems): if vs.HierLBItemIsClosed(dialID, kLB001, i): numbRedisplItems = vs.HierLBItemOpened(dialID, kLB001, i, True) elif item == kPB_Collapse: for i in range(numLBItems): if vs.HierLBItemIsClosed(dialID, kLB001, i) == False: vs.HierLBItemClosed(dialID, kLB001, i, True) def rundialog(): global dialID dialID = vs.CreateResizableLayout('Test Listbrowser', True, 'OK', 'Cancel', False, False) vs.CreateLB(dialID, kLB001, 60, 20) vs.CreatePushButton(dialID, kPB_Expand, 'Expand') vs.CreatePushButton(dialID, kPB_Collapse, 'Collapse') vs.SetFirstLayoutItem(dialID, kLB001) vs.SetRightItem(dialID, kLB001, kPB_Expand, 0, 0) vs.SetBelowItem(dialID, kPB_Expand, kPB_Collapse, 0, 0) if vs.RunLayoutDialog(dialID, dialogHandler) == 1: pass rundialog()
  20. Thank you very much @Gelde-Aart. As usual the Vectorworks Dev Wiki gives minimal assistance on usage. I got it to work without explicitly stating the LBControlType. I was missing the SetLBItemDisplayType call. Also my sequencing was a bit off. You need to call SetLBItemDisplayType before any other Enablings for the Listbrowser. Live and learn, live and learn.. edit Also you need to call "SetLBHierDispColumn" before "EnableLBHierDisplay" for some reason. 🤷‍♀️ Thanks again
  21. As Pat suggested GetSymLoc is the one you're wanting to use for plugin objects. I have no experience with Spotlight, so can't add to what Pat has mentioned apart from converting that into python: h2 = vs.FSActLayer() # Plugin Object h1 = vs.NextObj(vs.FIn3D(h2)) # Symbol With Plugin Object if h1 is None: vs.AlrtDialog('Nil') else: x2, y2 = vs.GetSymLoc(h2) x1, y1 = vs.HCenter(h1) vs.AlrtDialog("Insert Point is : {:.2f}, {:.2f}".format(x2, y2)) vs.AlrtDialog("Symbol Dims : {:.2f}, {:.2f}".format(x2 - x1, y2 - y1)) vs.AlrtDialog("Center of HP is : {:.2f}, {:.2f}".format(x2 + x1, y2 + y1))
  22. Greetings all, Anyone got the vs.SetLBHierDispColumn function to work? I can't seem to get it to display the listbrowser in a hierarchy. Just checking to see if possible/or if i'm doing something wrong before I file a bug report. Cheers Tui
  23. twk

    Data Tags

    h = Data Tag Object Handle import vs; def GetTaggedObject(h): result = False; num = vs.GetNumAssociations(h); assH = None assKind = None value = None i = 0; while(i < num and result == False): assH, assKind, value = vs.GetAssociation(h, i); if (assKind == 37): result = True; i = i + 1; return result, assH;
  24. twk

    Formatting OIP?

    My python work-in-progress template: def __temp_funcs(self): kObjXPropEditGroup = vs.SetObjPropVS(1, True) # -- Object has non-default "Enter Group" behavior. PIO objects can enter the profile or path group kObjXPropHasLayerScaleDeps = vs.SetObjPropVS(2, True) # -- Object wants to be reset with when its layer scale changes. kObjXPropPreference = vs.SetObjPropVS(4, True) # -- Object Definition Procedure (ODP) handles ParametricPreferencesMessage::kAction event. kObjXPropDirectModeling = vs.SetObjPropVS(5, True) # -- Object Definition Procedure (ODP) handles handles Direct Modeling events. kObjXPropAttributeTool = vs.SetObjPropVS(6, True) # -- Object Definition Procedure (ODP) handles handles Attribute Mapping events. kObjXPropCustomCursorResize = vs.SetObjPropVS(9, True) # -- // // boolean value // // The O kObjXPropDefaultPropertyUI = vs.SetObjPropVS(11, True) # -- // // unsigned char // // The bits in this property describe the UI displayed kObjXPropCustomHideFactor = vs.SetObjPropVS(16, True) # -- The parametric object provides custom scale threshold to be used to hide inner objects kObjXHasCustomWidgetValues = vs.SetObjPropVS(17, True) # -- OnObjectWidgetValueCall::kAction kObjXPropAcceptStates = vs.SetObjPropVS(18, True) # -- The parametric accpets ObjectState::kAction event kObjXPropPreserveContents = vs.SetObjPropVS(20, True) # -- VectorWorks will not delete the contents of the parametric kObjXPropHasContextMenu = vs.SetObjPropVS(21, True) # -- Sends ObjectContextMenuEvent::kAction_Init and ObjectContextMenuEvent::kAction_Event kObjXPropResetBeforeExport = vs.SetObjPropVS(23, True) # -- This plugin will be reset before Print or Export kObjXPropRedSymbolIsStyle = vs.SetObjPropVS(25, True) # -- Red Symbol of this object can be used to drag&drop kObjXPropHasAttrMappingGeom = vs.SetObjPropVS(26, True) # -- Sends ObjectGetSpecificGeometryCall::kAction with message is (OnObjectGetSpecificGeometry*) kObjXPropHasSectionVPGeom = vs.SetObjPropVS(27, True) # -- Sends ObjectGetSpecificGeometryCall::kAction with message is (OnObjectGetSpecificGeometry*) kObjXPropHasLayerElevDeps = vs.SetObjPropVS(28, True) # -- Resets the parametric if the layer elevation changes kObjXPropHasLayerHeightDeps = vs.SetObjPropVS(29, True) # -- Resets the parametric if the layer height changes kObjXPropLeaderLinePtIndex = vs.SetObjPropVS(33, True) # -- Controls whether how and a paremetric will be recognized by the align leader line menu command kObjXPropLabelPtIndex = vs.SetObjPropVS(34, True) # -- Controls whether how and a paremetric will be recognized by the align leader line menu command kObjXPropDataNameDisabled = vs.SetObjPropVS(35, True) # -- Controls whether the name field on the data pane should be disabled kObjXPropDirectionArrow = vs.SetObjPropVS(39, True) # -- Controls whether the direction arrow should be displaied kObjXPropIsSymbolBased = vs.SetObjPropVS(40, True) # -- Controls whether the object is symbol based and to show context menu "Locate Symbol In Resource Browser" kObjXPropTextStyleSupport = vs.SetObjPropVS(42, True) # -- Controls whether parametric objects can use class text style attribute and get Text Style on OIP kObjXPropDontShowZLocation = vs.SetObjPropVS(45, True) # -- When set to true will remove the Z coordinate for the location widget in the OIP for the parametric kObjXPropGetDragEvents = vs.SetObjPropVS(47, True) # -- Controls whether a parametric will recieve Drag events allowing it to draw custom geometry kObjXPropOIPNameHidden = vs.SetObjPropVS(48, True) # -- Controls whether the name field on the OIP should be hidden kObjXSupportsStyles = vs.SetObjPropVS(49, True) # -- Controls whether a parametric type support plug-in styles kObjXPropUseLayerCutPlane = vs.SetObjPropVS(51, True) # -- Controls whether a parametric object supports Layer Cut Plane values. kObjXPropAllowFreeHybrid2DPath = vs.SetObjPropVS(52, True) # -- Controls whether a Hybrid 2D Path parametric can have a path on a different plane than the object kObjXCatalogSupport = vs.SetObjPropVS(63, True) # -- Controls whether a parametric type supports catalogs kObjXPropDontShowTextureWidgets = vs.SetObjPropVS(64, True) # -- When set to true will remove the texture widgets in the Render pane of OIP for the parametric object kObjXPropHidePlanarDropDown = vs.SetObjPropVS(71, True) # -- When set to true will hide planar dropdown for the widget in the OIP for the parametric

 

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.

×
×
  • Create New...