Search the Community
Showing results for tags 'scripting'.
-
I'm asking if there is a way to script calculation of minimum sawn edge for a repeat tiling pattern given a known set of rules. If there's a way of solvng this mathematically without CAD I'd be very interested in that solution (it feels like there would be). A client asked me if I could find a way to utilise an area of old concrete as he likes my approach to reusing old materials. I suggested sawing the concrete into pavers in the shape of Cairo-type irregular polygon tiles – specifically type 4 (link below). This is the most blocky of the Cairo tiles, hence most suitable for this kind of work as least likely to break during processing, handling and laying. Rao 2018 Exhaustive search of convex pentagons which tile the plane. Page 15, Type 4 (second from right) in graphic. J Mathematics > Combinatorics. https://doi.org/10.48550/arXiv.1708.00274 [arxiv.org 200Kb .pdf] I've put page 15 into the vw file. (I have no idea why this very simple file is 13Mb!) I've now designed the surface using this form (image above - and .vwx encl). Due to rounding of angles tiles are not mathematically perfect i.e. if you zoom in you will see some slight overlaps across the surface - at this point I have not taken paver gaps into account (probably about 10mm at laying time). If it makes it eaier I would explode the symbols back to polygons - I image a script could traverse that more straight-forwardly. Rules for thinking about minimum edge length Paver edges within planters do not need to have a sawn edge and can utilise an existing broken/ existing edge. (red organic shapes will be raised planters that will sit over the edge of pavers - there will be no pavers under the planters as I want connection to the soil below). Where there are small white areas outside of the shapes, or where a tile edge nearly follows the planter edge I intend to use off-cuts to support the planter. Outer edge pavers do not need a sawn edge and can utilise an existing broken/ existing edge. The light-weight red closed polygon at the right of the area is a future brick path. Pavers crossing this line do not need a sawn edge and can utilise an existing broken/ existing edge. As shown pavers are a symbol, held by the class: 5 HS surface_-paver_Type4_Holder with the paver p 2ndolygon itself in another class: 5 HS surface_-paver_Type4 the brick surface polygon and the planter polygons are in their own separate classes: 5 HS_-court brick 5 HS_-court planters v3 dimensionable So … is this a problem that can be solved with vectorworks scripting, or is it an impossible ask? Tiling sawn edge length _Ald6.vwx
- 2 replies
-
- tiling
- irregularpolygon
-
(and 2 more)
Tagged with:
-
I am having trouble finding a guide on creating plug in objects. I have built 20ish scripts that all work fine and would like to build a plug in object similar to the built in Reference Marker tool with custom parameters and layout. Can someone point me at a step by step guide or supply sample code I can look at? Thanks so Much
-
Hello, I’m wanting to start to push the boundaries of what can be done with Vectorworks, and am seeking direction for best practices, Scripting resources, and or any additional materials that you may deem helpful in this endeavor. Really looking to program repeat tasks and sequences that I currently use in my daily workflow. And I would like to be able to develop a customized “super” template that has a centralized repository for all future drawings to save time on production efforts. Which language should be best utilized from a programming point of view, and is there recent documentation for the most current release? Thanks, Ryan Russell
-
Is it possible to get the filepath of a document using Applescript? I didn't know where exactly to post this question. Thanks for any help.
-
When adding scripts to worksheets, there is a dialog box that pops up every time saying would you like to block or execute scripts in this worksheet? Question: Can we somehow block or execute this option, through a script?
- 3 replies
-
- worksheets
- vectorscript
-
(and 1 more)
Tagged with:
-
Greetings and Happy New Year to you all, Has anyone figured out how to duplicate an object (locus,symbol) along a 2D path, be it a polyline, polygon? Developing a plugin to take a symbol object and have it duplicate along the Plugins 2D path (this being a 2D poly path plugin object type). Have tried the : def vs.GetPointAndParameterOnNurbsCurveAtGivenLength(inNurbCurve, inPercentOfLength): return (BOOLEAN, p, outParam, outIndex) by converting the 2D path to a nurbs object, running the calc, then copying the /out/ data to the 2D path poly. However just realised the convert to Nurbs command takes into account the orientation of the view. This makes it not feasible for a path-pio object. Any ideas? Cheers, Tui
-
Hi all, I am creating a Linear plug-in object, and trying to catch and respond to the event where a user changes the LineLength by moving one of the two built in control points of the object. However, I cannot seem to figure out what event / state change this qualifies as. The vso states I know of are: vs.kCreatedReset = 0 vs.kMovedReset = 1 vs.kRotatedReset = 2 vs.kParameterChangedReset = 3 vs.kObjectChangedReset = 4 vs.kLayerChangedReset = 5 vs.kExitFromEditGroup = 6 vs.kObjectNameChanged = 7 Below is an example of some code I have used to try to detect this state change. Alerts appear as expected for move, rotate, attribute change, and parameters changed either in the OIP or by moving an added Conrol Point parameter in the drawing, but when I drag the two points that are actually built in to the PIO, although I do receive 3 for the event, triggering the ResetEventHandler in this case, no alert fires off for any of the checked state changes. It seems that this state change is not one of those listed above. I expected it to be a Param change along with possibly a rotation and position change, depending on which of the two points was dragged. Can anyone advise on what state I need to check for, and how I can capture the new and old value for line length, rotation, and position that could have been adjusted by this action? def execute(): global objname, oh result, objname, oh, rh, wh = vs.GetCustomObjectInfo() theEvent, message = None, None theEvent, message = vs.vsoGetEventInfo() if theEvent == vs.kObjOnInitXProperties: #5 #enable eventing for this plug-in vs.SetPrefInt( vs.kParametricEnableStateEventing, 1 ) #590 result = vs.SetObjPropVS(vs.kObjXPropAcceptStates, True) #18 elif theEvent == vs.kObjOnAddState: #44 message = vs.vsoStateAddCurrent( oh, message ) elif theEvent == vs.kParametricRecalculate: #3 ResetEventHandler() def ResetEventHandler(): global objname, oh if vs.vsoStateGet( oh, vs.kCreatedReset ): vs.AlrtDialog("Object Just Created") if vs.vsoStateGet( oh, vs.kMovedReset ): vs.AlrtDialog("Object Just Moved") if vs.vsoStateGet( oh, vs.kRotatedReset ): vs.AlrtDialog("Object Just Rotated") if vs.vsoStateGet( oh, vs.kParameterChangedReset ): vs.AlrtDialog("Parameter Changed") if vs.vsoStateGet( oh, vs.kObjectChangedReset ): vs.AlrtDialog("Object Changed")
-
I created a plugin object using python. The main code was pasted into the script editor via the plugin manager. I compiled the script and the plugin item works as it should. Now I would like to lock the script. I'm on a mac and recently made the jump from Vectorworks 2008 to 2016. In the past when creating a vector script I could lock it by holding down 'command' + 'option' + 'shift' + 'caps lock' (it was important that all external files had the extension .px) Now i'm in 2016 and scripting with Python. I only have 1 other file in addition to "import vs", which is, "import shapes" when i compile my script (shapes.py). It finds this file via the scripts options/environment paths. How do I go about locking or encrypting this plugin object? also, I do have a __init__.py file included in the folder that contains shapes.py
-
Greetings, Anyone know the maximum size of characters a Parameter/Record field can hold? Needing a place to store a series of xyz co-ordinates from a user-defined polygon. And thinking to store it in a static text parameter of my pio. There's no way to foreknow the number of vertices as its userdefined. But the location of each vertex is crucial to my calc. Thanks