Jump to content

Search the Community

Showing results for tags 'vectorscript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Announcements
    • Announcements
    • News You Need
    • Job Board
  • Feedback
    • Roadmap
    • Wishlist - Feature and Content Requests
    • Known Issues
    • Wishes Granted / Issues Resolved
    • Forum
  • General
    • Troubleshooting
    • General Discussion
    • Architecture
    • Site Design
    • Entertainment
    • Vision and Previsualization
    • Braceworks
    • ConnectCAD
    • Energos
    • Rendering
    • Workflows
    • Buying and Selling Vectorworks Licenses
    • Hardware
  • Customization
    • Marionette
    • Vectorscript
    • Python Scripting
    • SDK
    • 3rd Party Services, Products and Events
    • Data Tags
  • Solids Modeling and 3D Printing
    • Subdivision
    • Solids Modeling
    • 3D Printing
  • Vectorworks in Action
  • Archive
    • Resource Sharing
    • Machine Design


  • Knowledgebase
    • Tech Bulletins
    • Troubleshooting
    • Workflows
    • How To
    • FAQs


  • Marionette - Objects
  • Marionette - Networks
  • Marionette - Nodes
  • Marionette - Menu Commands

Product Groups

There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me






  1. Hello, I'm interested in listing the coordinates for the vertices of 2d features via python/vs. However, if I clip a hole out of the middle of the shape, I don't see any way to interact with the interior vertices of the resulting polylines. GetVertNum and the Object Info Palette both only list the vertices on the outside ring of the polyline. Is there something I'm missing here? I've attached an example, where VW displays 5 vertices instead of the desired 9. Thanks!
  2. Hello, all. Looking at the VectorScript function reference I see no functions that could tell whether a given polygon/polyline is self-intersecting. The only function that is told that it is the VS:OffsetPoly. But I don't want to see if a polygon/polyline is self intersecting as a side effect of an operation that actively acts on the selected object but just a read-only operation whether it is self-intersecting or not. Any suggestions are welcome.
  3. Hello, some time ago I made a Vectorscript Menu command that computes the current date and writes to a database record. Now I'd like to implement this in a Marionette Object. Whenever I click a button in the OIP of the Marionette Object it should call the Vectorscript. Is this or something similar possible and how do I do it? Thanks for help VvierA
  4. Had trouble setting singular constraints.. Discovered the correct settings for vertically constrained objects are as follows: vs.MoveTo(0,0) vs.LineTo(0,100) h = vs.LNewObj() vs.SetSingularConstraint(4, h, 1, 2)
  5. How can I create a parametric object with Vectorscript?. For example, I want to create a rectangle that has a certain figure inside but which can use that figure as a symbol and which can change the parameters in the object information palette. I want to create this figure as a symbol and have parametric properties to change each point independently.
  6. Hi everyone, I would like to be able to write scripts that change objects on a given layer/class. I will want to do things like: changing fill or pen colour/thickness or switching a particular layer/class off. Can you please advise me whether there is a good example of a similar script out there that I could have a look at and use as a guideline when adjusting to fit my needs? Thank you very much!!
  7. Hi everyone, I need to write a script that finds all objects with a specific RGB fill, and for these objects sets a specific pen thickness (like an outline). Below is my first attempt and attached what it says the errors are. Thanks a lot for helping! PROCEDURE LWUpdate; FUNCTION ChangeThickness(h :HANDLE) :BOOLEAN; CONST { substitute these with the required values } ToLW = 0.35; {mm} VAR r, g, b :LONGINT; VToLW:REAL; BEGIN GetFillBack(h,r,g,b); IF (r = 34952) & (g = 34952) & (b = 34952) THEN SETLW(h, VToLW); GetFillFore(h,r,g,b); IF (r = 34952) & (g = 34952) & (b = 34952) THEN SETLW(h, VToLW); END; BEGIN { Each object option here is set to affect all objects, on all layers, using a deep traversal} VToLW := ToLW / 25.4 * 1000; ForEachObjectInLayer(ChangeThickness,0,2,1); END; Run(LWUpdate);
  8. Hi everyone, I cannot seem to work out why my lines won't change thinckness. Might I be setting the values in the script wrong? The attached screenshot shows attributes of an example line I need to change. It's thickness is 0.25, and just to see the change clearly, the new thickness would be 1. What am I doing wrong please?? The script otherwise compiles. PROCEDURE LineWeightChange; { © Petri Sakkinen 2008 } CONST { substitute these with the required values } oldWeight = 0.25; newWeight = 1; PROCEDURE ChangeIt (h : HANDLE); BEGIN SETLW(h, newWeight); END; BEGIN FOREACHOBJECT(ChangeIt, LW = oldWeight); END; RUN(LineWeightChange); Thanks for helping!
  9. Hi everyone, I would like to start automating some tasks I am performing in VW using Vectorscript but am new to it. The first task I would like to automate is SELECTING ALL OBJECTS OF A CERTAIN FILL FORE COLOUR (rgb values, in this case specifically 255, 255, 204) AND CHANGING THE FILL FORE COLOUR TO DIFFERENT COLOUR (rgb values 187, 209, 96, ideally, but not necessarily also 40% opacity). It is important to perform all at once, since I want to be able to perform multiple such specific colour and line colour/weight changes all at one go. From studying tutorials and adjusting the script in 'Setting/Changing Object color' thread, this is what I have: PROCEDURE GreenUpdate; FUNCTION MakeItGreen(h :HANDLE) :BOOLEAN; VAR r, g, b :LONGINT; BEGIN GetFillBack(h,r,g,b); IF (r = 255) & (g = 255) & (b = 204) THEN SetFillBack(h,187,206,96); GetFillFore(h,r,g,b); IF (r = 255) & (g = 255) & (b = 204) THEN SetFillFore(h,187,206,96); END; BEGIN { Each object option here is set to affect all objects, on all layers, using a deep traversal} ForEachObjectInLayer(MakeItGreen,0,2,1); END; Run(GreenUpdate); The script compiles but does not do anything! I tried to delete as little from the original as possible not to mess it up.. Thanks so much for helping 🙂
  10. 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
  11. Hi all, Ran into a snag with the vs.GetLayer(h) command in marionette. Instead of returning a handle to the layer of the object, it returns a handle to the current layer in the document. What am I missing? Do I need to regenerate the object/something along those lines? I've attached a script with a modified Get Layer node that returns the name of the layer rather than the handle (just so it's easier to see what you're getting back). Any help appreciated! Thanks, Naomi Get Layer.vwx
  12. I'm using vectorscript/python to make an list of all objects with an certain record and using information from this record. to eliminate human errors I'm starting the script with making the record so I'm certain all names and fields are correctly named. The thing that i can not get working at the moment is making an field in the record with an option module. so an field where you can not type but you have to choose between predefined options. does someone know if this is possible to create? when you make an record yourself in VW this is possible so why not with scripting
  13. Hi all, Coding question for those who write their own nodes. Every time I try to run a node with the (a,b) = vs.TrueTypeToPoly(text) the program crashes - has anyone run into this/has any suggestions? I've attached a simple sample node that creates text and then uses the above command to turn it into poly lines. It doesn't crash if I don't try to assign the output to the tuple (a,b), but also doesn't convert the text. Thanks, Naomi text test.vwx
  14. Hi I am wondering if anyone can advise - I have enabled the reset on move and reset on rotate flags in my PIO, and the handling of these events seems to work correctly when a single PIO is selected. However, if I select other objects along with the PIO, there are some issues. If the other objects are simple objects like rectangles, etc, their 'preview shadows' move as expected while the operation is in progress, but they do not redraw correctly after the move or rotate operation is completed. The other object appears to remain drawn in its old location. But if I move my mouse around, I can find that the object did in fact move / rotate correctly but is now invisible except to selection highlighting. If I select it and change an attribute, the drawing correctly refreshes. The incorrect 'old' object disappears. If I have multiple instances of my PIO selected, and perform a move or rotate, one of them behaves correctly. The others mostly behave correctly, but appear grayed. If I select them and change an attribute or otherwise force a reset, they return to normal. In addition, I sometimes observe drawing objects that were not part of the selection becoming grayed when I perform these operations. Is there something I am doing wrong or a step I need to add?
  15. Wondering if anyone can advise on this - I'm having some trouble with control point precision that is leading to erroneous behavior in a plugin object. I detected this issue in part through the debugger. Basically, when I drag a control point, it seems that the values I get when I access its coordinates from inside the scripting environment are truncated to only 6 decimal places. This introduces error into calculations based on that value. I have tested further by creating an object to use as a snapping location, and setting the position of this object to coordinates that require more than 6 decimal places to represent. If I increase the decimal place precision in the document unit preferences, I can see all of these decimal places in the OIP for the reference object. If I drag a control point in my plugin object to snap to this reference object, and then, by setting a breakpoint, inspect the value I get inside my script by accessing the control point (with, for example, vs.PControlPoint01Y), I see the value is still truncated, regardless of the document unit / precision settings. At only 6 decimal places, this can introduce pretty significant error. Is there some obvious thing I am missing to correct this behavior? I would expect that when I snap a control point to a location, the control point would be assigned a value as accurate as possible, or at least as accurate as the document settings indicate. Not sure if this is specific to Python scripting or not.
  16. Hi all, I open this topic because i cannot find how to make custom parametric object for vectorworks such as custom door(with custom profile), custom furnitures etc. Can anyone enlight me for this? If there is need to do with marionette or vectorscript. Where can i find the tutorial? I am newborn baby in Vectorworks, planning to migrate here. Sir @Pat Stanford i tag you here 😉. Thank you
  17. So I've created a simple script that duplicates a selected symbol from a pop-up window. I've also added an event script that changes the "Distance" parameter based on the symbol selected. Developer mode is 'off', but I don't understand why when the PIO is executed that it creates a second set of symbols outside of the PIO. That second set of symbols are always in the exact same location in every drawing, regardless of where the PIO is. I've attached a screen shot if it's helpful. Any ideas why?
  18. Hi I use a Logitech M570 roller ball mouse with Vectorworks which has some customisable buttons. I have customised the buttons for various standard VW shortcuts but would like to be able to use it to edit the attributes of objects. I can select an object and right click and access a menu with options like edit properties etc none allow me to edit the attributes - ie change the fill or line weight. ( Right click on my mouse is the same as pressing control then clicking on the object ) I can input a short cut to open and close the attributes palette but this does not allow me to edit the attributes of a selected object. Does anyone know how I can create a shortcut I can put into the mouse so I use a mouse button to select and edit the attributes of a object? I suspect I need a VW script to make the shortcut but am not familiar with scripting. Thanks
  19. Hello, I am glad that I can see some evolution in my skills. And thanks to this forum I can manage more tedious work easy and nice. In reward here is the first really useful script in vectorscript. It creates some layers all together with date and different text. I hope you enjoy. Notes: -If the layer exist give back an alert and do not create the layer. {/////////////////////////////////////////// CreateDifferentNewLayers V 1.3 with extra separation layer with date By Ing. Victor Garzon (2018) distribute freely avictorgm@gmail.com Using as codebase from Vectorworks: (c) 2001 Nemetschek North America. Distribute freely. ///////////////////////////////////////////} PROCEDURE CreateDifferentNewLayers; VAR newname : STRING; Rahmen : STRING; LayA : STRING; LayZERO : STRING; LayB : STRING; LayC : STRING; LayD : STRING; LayE : STRING; LayF : STRING; LayG : STRING; LayH : STRING; TextoAlert :STRING; Texto1 :STRING; Texto2 :STRING; ch : HANDLE; BEGIN Texto1:= 'The Layer for the Stand '; Texto2:= ' will be created at the top of the list'; newname:= StrDialog('Enter name of new layer:','Untitled Layer'); LayZERO:= Concat('-------', newname, Date(2,1), '--------------------'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayZERO); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayZERO, Texto2); Layer(LayZERO) END ELSE AlrtDialog('Layer Layers created already exists.'); LayH:= Concat(newname, '_8_Frei'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayH); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayH, Texto2); Layer(LayH) END ELSE AlrtDialog('Layer name already exists.'); LayG:= Concat(newname, '_7_Standfläche'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayG); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayG, Texto2); Layer(LayG) END ELSE AlrtDialog('Layer name already exists.'); LayF:= Concat(newname, '_6_Traversen'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayF); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayF, Texto2); Layer(LayF) END ELSE AlrtDialog('Layer name already exists.'); LayD:= Concat(newname, '_5_Lasten'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayD); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayD, Texto2); Layer(LayD) END ELSE AlrtDialog('Layer name already exists.'); LayE:= Concat(newname, '_4_Punkte'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayE); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayE, Texto2); Layer(LayE) END ELSE AlrtDialog('Layer name already exists.'); LayA:= Concat(newname, '_3_Maße_Lasten'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayA); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayA, Texto2); Layer(LayA) END ELSE AlrtDialog('Layer name already exists.'); LayB:= Concat(newname, '_2_Maße_Punkte'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayB); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayB, Texto2); Layer(LayB) END ELSE AlrtDialog('Layer name already exists.'); LayC:= Concat(newname, '_1_Maße_Träger'); IF NOT DidCancel THEN BEGIN ch:= GetObject(LayC); IF (ch = NIL) THEN TextoAlert:= Concat(Texto1, LayC, Texto2); Layer(LayC) END ELSE AlrtDialog('Layer name already exists.'); END; Run(CreateDifferentNewLayers);
  20. Hi , I'm just messing a bit around with Vectorscript.( I'm completely new to this, and try to do my first steps...) As a start I wanted to create a script that moves all selected items to the origin, but Im not very sucsessful in this. Here is whatI have so far: PROCEDURE MoveZero; VAR h : HANDLE; BEGIN h:= FSActLayer; HMove(h, 0, 0); END; Run(MoveZero); My questions: 1.) FSActLayer chooses only the first object on the active layer, how do I choose all selected objects? 2.) HMove(x,x,x ) moves only relative to the current location, what is the command to move to a certain point ? Thanks for help...
  21. 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?
  22. I am working on a simple Dialog with a set of Radio Buttons - depending on the selection, the script will perform different sub-procedures. I can't find a VS command to get the selected Radio Button. Any suggestion? thanks in advance! Giovanni
  23. This would essentially be a Boolean parameter for PIOs which does not look like a check box. It could have two script loaded images (tool resources?) to display in the OIP to indicate the state of the button and return TRUE/FALSE. The same concept applied to a Radio Button parameter. Each choice having the ability of displaying one of two images (no text or radio button). Default image = non-selected, Alternate image = selected option. This could possibly lead to additional functionality of being able to select more than one option. This could be achieved by passing indices or Boolean flags back to the script. A PIO script can easily parse the result via a case statement. Once UTF-16 is fully implemented there maybe sufficient glyphs available that a button outline with text embedded will be able to convey the desired thought. The outline or background would alter to convey select state. Please ignore if this is in the current version. This office is using VW2013
  24. Greetings all, Functions mentioned in title [vs.GetProjectUserNames(), vs.GetResourceTags()] return NoneTypes, not sure whether this is broken. From the DevWiki: http://developer.vectorworks.net/index.php/VS:GetProjectUserNames Description : Get a list of userids that are part of the current project. def vs.GetProjectUserNames(): return (BOOLEAN, userArray) userArray | ARRAY : Array of userids as strings However, upon running this in a Project File, I get a Boolean of True, but a NoneType for userArray. Not sure how to iterate through list of results. This is the same with vs.GetResourceTags(): From the DevWiki: Description : Gets the tags attached to the specified resource. def vs.GetResourceTags(handle): return tags tags | ARRAY : Array of tags Running this on Symbol Definition handle, with tags attached yields a NoneType as well. The Symbol Definition has got tag(s), and running vs.GetNumResourceTags(some_handle) returns the correct number of tags attached to this resource. Any insight would help, @orso b. schmid/ @Pat Stanford
  25. I’m using VW2017 with Spotlight and I use the ‘rotate left 90 degrees’ command as a keyboard shortcut a lot. I’d like symbols to automatically rotate around their insertion point but mine don’t when I’ve got a label legend applied to them. When the label legend is applied the symbol rotates around the centre point of the symbol and the legend combined instead. I've explored using a vectorscript to help here but haven't got enough knowledge to make it work. I've noticed when I insert a locus on top of the insertion point and highlight both the symbol and the locus, the symbol will rotate around the locus. Could a script: insert locus on insertion point, rotate left 90degs, delete locus? Many thanks in advance!
  • Create New...