Jump to content

twk

Member
  • Posts

    665
  • Joined

  • Last visited

Everything posted by twk

  1. You can find it on this page: (Scroll to bottom of page) https://developer.vectorworks.net/index.php/Vectorworks_Scripting#Version_Information
  2. Here is a stripped out version from my custom python library for a geometry object. In this case the object must be a 3D type (Mesh, Extrude, 3DPoly, Nurbs, etc); And this is only for the 3D bounding box points. Josh is right, if its a mesh object, there are function calls to get the actual vertex points. import vs class GEOMETRY3D(): class POINT3D(): def __init__(self, x, y, z): self.x = x self.y = y self.z = z def __sub__(self, other): self.x -= other.x self.y -= other.y self.z -= other.z def __add__(self, other): self.x += other.x self.y += other.y self.z += other.z def mid_point_to_other_point(self, other_point): return def length_to_other_point(self, other_point): return def get_offset_pt(self, offsetX=0, offsetY=0, offsetZ=0): return GEOMETRY3D.POINT3D(self.x + offsetX, self.y + offsetY, self.z + offsetZ) def __init__(self, handle): self.handle = handle self.generate_bounding_box() def generate_bounding_box(self): self.top_center = GEOMETRY3D.POINT3D(self.center.x, self.center.y, self.center.z + (self.depth / 2)) self.bottom_center = GEOMETRY3D.POINT3D(self.center.x, self.center.y, self.center.z - (self.depth / 2)) self.top_back_left = self.top_center.get_offset_pt(-self.width / 2, self.height / 2) self.top_back_right = self.top_center.get_offset_pt(self.width / 2, self.height / 2) self.top_front_right = self.top_center.get_offset_pt(self.width / 2, -self.height / 2) self.top_front_left = self.top_center.get_offset_pt(-self.width / 2, -self.height / 2) self.bottom_back_left = self.bottom_center.get_offset_pt(-self.width / 2, self.height / 2) self.bottom_back_right = self.bottom_center.get_offset_pt(self.width / 2, self.height / 2) self.bottom_front_right = self.bottom_center.get_offset_pt(self.width / 2, -self.height / 2) self.bottom_front_left = self.bottom_center.get_offset_pt(-self.width / 2, -self.height / 2) @property def bounding_box_points(self): """ Top to bottom, Top Left Back to Top Front Left Counterclockwise --> then Bottom.. :return: """ return self.top_back_left, self.top_back_right, self.top_front_right, self.top_front_left, self.bottom_back_left, self.bottom_back_right, self.bottom_front_right, self.bottom_front_left @property def center(self): ptxy, z = vs.Get3DCntr(self.handle) return GEOMETRY3D.POINT3D(ptxy[0], ptxy[1], z) @property def height(self): return vs.Get3DInfo(self.handle)[0] @property def width(self): return vs.Get3DInfo(self.handle)[1] @property def depth(self): return vs.Get3DInfo(self.handle)[2] # obj3D = GEOMETRY3D(vs.FSActLayer()) # for x in obj3D.bounding_box_points: # vs.Locus3D(x.x, x.y, x.z)
  3. As soon as I went back into Vectorworks, I figured out what the issue was. I'm in a project sharing file, and even though I had all the walls checked out, I had to check out the the WinDoor objects as well. I think this is by design, as the Data Manager does a document wide setting when in use. Working now.
  4. Trying to add a data sheet to the WinDoor object (@Julian Carr), however the Data Sheet is shown grayed out still on the Object Info pallette Data Tab. Also the WinDoor needed to be added manually to allow for Data Mapping, it wasn't set by default. Also the WinDoor object already has IFC data on it? Is this programmed internally? I would like to setup a datasheet to just show the ID and certain UserID fields. Any help is much appreciated.
  5. Thanks @Vlado and @Dave Donley, I managed to sort it out. Using the vs.GetAssociation calls on the texture resource handle
  6. With a bit of trial and error, and crossing my eyes through DebugList view, it turns out, the vs.GetAssociation(handle, i) and vs.GetNumAssociations(handle) did the trick. The debuglist view did show the hatch handle, buried under a AssociationNode.
  7. Does anyone know, how we can find out what hatch is being used in a particular texture? Has it got anything to with Shader Records? I can't seem to find anything. https://developer.vectorworks.net/index.php/SDK:Using_Shader_Records @Rick Berge @Vlado @JBenghiat
  8. I have been using the python external libraries openpyxl and pandas dataframes for data exchange between vectorworks and excel. They have very good documentation. https://openpyxl.readthedocs.io/en/stable/ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
  9. I am trying to get wall data, via the wall style selectors on this page: https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#wallstyle The note at the bottom of the table says: Pass the handle returned by GetWallPreferences or GetSlabPreferences to access Wall/Slab Preferences values for all selectors. I can't seem to get the description or mark values for a wall style. Has anyone else had the same issue?
  10. Nice share @_c_! Finally got my group widgets working after months of trial and error. My widget indent calls were in the kObjOnWidgetPrep function not the kObjOnInitXProperties. (Funny that indentation works in kObjOnWidgetPrep without the Grouping) Again, thank you and thank you.
  11. I'll chime in for the NZ market, we are using the MasterSpec system that has plugins for both Archicad and Revit (Master Key). If we could get integration for vectorworks that would be awesome! https://masterspec.co.nz/
  12. We have also transitioned into vw2021, from vw2019, and just getting my head around the General Notes/Call Out Notes/Notes Manager workflow. A colleague who is setting up notes for the General Notes tool has found out that you can't Add multiple notes at the same time with this new workflow. You were able to in 2019. Is this WAD?
  13. I may have a copy of 12.5 somewhere. I have used in past for Windows 10 successfully, opening older projects for clients wanting changes/renovations some 10 years later! I will PM you, @Victoria Bowles
  14. Another thing that comes to mind is the position of the model in the design layer. We've noticed if you draw too far away from the origin, or your model is too far away, the openGL render craps out.
  15. 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.
  16. =('VAA Title Block'.'__DwgScale') __DwgScale is the field you're looking for
  17. wow, I did not know this. Very similar to the script I have. Apart from not being able to pre-select scaling conditions:
  18. +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 😁)
  19. 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?
  20. 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
  21. Maybe create a temporary symbol > add all other symbols in there > place on drawing > export as image > delete temporary symbol
  22. 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.
  23. 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.
  24. Ahh yes, that would be me, I forgot I had even signed up as a contributor.
  25. @_c_ this is nothing short of amazing. Truly, thank you for reviving this! Happy New Year from the southern hemisphere!
×
×
  • Create New...