Jump to content

Search the Community

Showing results for tags 'vectorscript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Announcements
    • Announcements
    • News You Need
    • Job Board
  • Feedback
    • Roadmap
    • Wishlist - Feature and Content Requests
    • Known Issues
    • Wishes Granted / Issues Resolved
    • Forum Feedback
  • General
    • Troubleshooting
    • General Discussion
    • Architecture
    • Site Design
    • Entertainment
    • Vision and Previsualization
    • Braceworks
    • ConnectCAD
    • Energos
    • Rendering
    • Workflows
    • Buying and Selling Vectorworks Licenses
    • Hardware
  • Customization
    • AI Visualizer
    • 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

Calendars

  • Community Calendar
  • Training Calendar
  • Webinars
  • Community Groups

Categories

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

Categories

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Occupation


Homepage


Hobbies


Location


Skype

  1. Hello I'm trying to use the following .py code in Vectorscript as a Python script. Compiling works. The application fails and the libraries are referenced. The libraries are there. what do i have to do? Thanks for your help! import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d.art3d import Poly3DCollection def create_turtle_shell(mesh_points, num_layers=5, layer_thickness=0.1): """ Erstellt schalenartige Elemente um die Hülle des 3D-Objekts. Parameters: - mesh_points: Eine Nx3-NumPy-Array mit den Koordinaten der Meshpunkte. - num_layers: Die Anzahl der Schichten. - layer_thickness: Die Dicke jeder Schicht. Returns: - turtle_shell: Eine Poly3DCollection, die die schalenartigen Elemente repräsentiert. """ turtle_shell = [] for i in range(num_layers): shell_points = mesh_points * (1 + i * layer_thickness) hull_faces = create_convex_hull(shell_points) turtle_shell.append(hull_faces) return turtle_shell def create_convex_hull(points): """ Erstellt die konvexe Hülle für eine Menge von Punkten. Parameters: - points: Eine Nx3-NumPy-Array mit den Koordinaten der Punkte. Returns: - hull_faces: Eine Poly3DCollection, die die konvexe Hülle repräsentiert. """ from scipy.spatial import ConvexHull hull = ConvexHull(points) hull_faces = Poly3DCollection([hull.points[face] for face in hull.simplices], alpha=0.2) return hull_faces # Beispiel: Erzeuge zufällige 3D-Punkte np.random.seed(42) mesh_points = np.random.rand(100, 3) # Erzeuge die schalenartigen Elemente turtle_shell = create_turtle_shell(mesh_points) # Visualisierung fig = plt.figure() ax = fig.add_subplot(111, projection='3d') for layer in turtle_shell: ax.add_collection3d(layer) ax.scatter(mesh_points[:, 0], mesh_points[:, 1], mesh_points[:, 2], c='r', marker='o') ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') plt.show()
  2. Hi there, Unfortunately, I have little to no experience with Vectorscript. So far I have created scripts via Marionette or menu commands. I often want to select Light Instruments by its "Fixture Name". Therefore I used Vectorscripts to select them by their individual name. Script looks like this: DSelectAll; SelectObj(INSYMBOL & INVIEWPORT & ((PON='Lighting Device') & ('Lighting Device'.'Inst Type'='ALEDA B-EYE K20'))); I have all these scripts in the Scriptpallette: 'Sel Scheinwerfer' The annoying thing is that so far I have to modify each script individually as soon as I add new light instruments to the drawing which I have not used before. It would be great if its possible to use a script that creates the individual scripts for the light instruments currently imported in the drawing. Is this possible? Maybe someone can point me in the right direction. Thanks for your help in advance Tom
  3. Hi, I'm trying to build a workflow that can create plant symbols from data supplied from a spreadsheet. Since create plant style function is not available, my idea is to duplicate an existing plant symbol then replace the record values. I have customized a node which contains CreateDuplicateObject (to create a duplicate of the original symbol), SetName (to assign a name to the new symbol) and Plant_UpdatedTranslat (to give the new plant symbol a different ID). It seems doing the job. I can see that the symbol has been created, the name and ID have both changed from the Resource Manager preview. But things became strange when I inspect the plant style setting. The duplicate has the exact same name and ID as the original which means the data preview in the resource manager is incorrect. I'm not sure what I did wrong. I suspect some of the plant data cannot be updated by script such as Latin Name, Scheduled Size etc. as the 'Set Record Field' node does not seem to work on tree symbols. If someone can help that would be greatly appreciated.
  4. I normally write my labels as a single text file (each label as a single paragraph), drag it into VW and then copy and paste out of it into single labels [I have no need or use for the call out system as it's not fit for my purpose]. Then I just drag them into position and I'm done. Is there a script (or Marionette) that will break a single text block into multiple text blocks based on eg carriage returns or space between paragraphs?
  5. 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!
  6. 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.
  7. 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
  8. 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)
  9. 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.
  10. 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!!
  11. 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);
  12. 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!
  13. 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 🙂
  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. 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
  16. 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
  17. 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
  18. 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?
  19. 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.
  20. 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
  21. 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?
  22. 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
  23. 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);
  24. 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...
  25. 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?
×
×
  • Create New...