Letti R
Member-
Posts
83 -
Joined
-
Hello, if only the offset (o) and the angle (a) is given than the formula would be: sin(a) = r / (o + r) with (o + r) as the hypotenuse of the big triangle. Now you can just copy this formula into the solver of your choice (i normaly use wolframalpha.com). The solution for r is: r = o * sin(a) / (1 - sin(a)) And just for the fun of it, here is the step by step solution: sin(a) = r / (o + r) (o + r) * sin(a) = r o * sin(a) + r * sin(a) = r o * sin(a) = r - r * sin(a) o * sin(a) = r * ( 1 - sin(a)) o * sin(a) / ( 1 - sin(a)) = r Regards, Letti
-
Hello, i made a new version of the tool. Now the additional length can also be less than 0 (but must be greater than some lower limit that is calculated from the geometry of the polygon. This can be used to make smaller T-, or Dog-Bones that only fit if you push the pieces into eachother. This version of the tool should work with Vectorworks 2023 and newer. 2D Mill Fill_0_2_2.vst Regards, Letti
-
Hello, i made another tool that can create shadows that are polygons from 3D objects such as Extrudes, 3D Polygons, Sweeps, Solids and so on. The shadow will always be drawn on the xy plane of the layer (z=0). There are two modes you can choose from Parallel light and Sun. Parallel light: To use parallel light as a "lightsource" you can set the direction of the light to every vector you like in the tools settings. Sun: If you have placed a heliodon object in your drawing then you can use the settings of the heliodon to change the direction of the light. If you have multiple heliodon objects in your drawing the tool will prompt you to chose one. You can also use multiple heliodon objects to draw multiple shadows at once, they just need to be on the active layer and you have to have them selected aswell. In this case the shadows that belong together are put in groups. 3D Poly Shadow.vst The Tool was written and tested for Vectorworks 25, but since it is written in Python it should also work for other Versions of Vectorworks. Regards, Letti
-
Hello, The RGB values have to be 16 bit. This means they have to be between 0 and something like 65000. For exact values you can look inside some Marionette node. Regards, Letti
- 1 reply
-
- scripts
- vectorscript
-
(and 3 more)
Tagged with:
-
Hello, because this tool is written in Python, the Version for Vectorworks 24 i posted before does also work with Vectorworks 25. I was just able to test it. I also wanted to point out, that the tool ofcourse also works without the text objects. I am not sure if i made that clear enough in my previous post, but unfortunately i cant edit the post anymore. Here are some more examples of shadows you can draw with the tool without the text objects. Outer shadows: Inner Shadows: Regards, Letti
-
Hello, i wrote a Python tool for Vectorworks that can create shadows of rectangles, polygons or polygonal polylines (polylines without roundings). You can use it by selecting one or more rectangles, polygons or polygonal polylines and than selecting the tool. With the next two clicks the tool will let you draw a line, that is the length and direction of the shadows. The tool has two basic modes you can chose from, shadow outside of the object or shadow inside of an object. If you have multiple objects selected you can also chose to combine the shadows or to draw a shadow for each object individualy. If you place text objects with numbers in it onto the selected objects, the length of the shadow of this object will be multiplied by the number in the text object (the text objects also have to be selected), as if these objects have a "height". This feature supports roman numerals aswell as decimal numbers with dot and comma. If you have several objects with different "heights" you can also check the "self-shading" checkbox if you want the tool to also draw shadows on the "lower" objects. This Feature is only availible for outer shadows that get merged. But be careful, this feature may increase the time it takes to calculate the shadows drasticly. I wrote and tested this tool for Vectorworks 24, but i also made a version for Vectorworks 22. Unfortunately there are some known issues that cant be fixed because this tool was written in Python: If shadows reach out of the current view of vectorworks, they might not be drawn correctly To draw the temporary line with the tool that represents the length and the direction of the shadow, you sometimes need an extra click If you want to see what the tool can do, please have a look inside the showcase file. If you like this tool please consider hitting the like button. If you do not like the tool please leave a message, so i can hopefully improve the tool. For Vectorworks 24: 2D Poly Shadow.vst2d_schatten_24_showcase.vwx For Vectorworks 22: 2D Poly Shadow.vst2d_schatten_22_showcase.vwx Please be aware that there will be bugs in this tool. If you find one please leave a message. I am not responsible for any harm this tool does to your system, or for any illegal use of this tool. Regards, Letti
-
Hello, Marisas code works fine. Its just that the while loop is not running at all if you dont have an object with the name "START" to begin with, wich may not be what you want. One could say that the two loops you posted in the beginning are two different kind of while loops. The first one is a normal while loop that runs as long as a condition is true, but if the condition is false right from the beginning, than the body of loop never gets executed. The second loop behaves more like a "do-while" loop. Its mostly the same as the while loop, with the difference that its body is executed at least one time. However in your last example you dont realy need the second if statement. Something like this: TESTNAME = 'START' while True: TESTNAME = vs.StrDialog('TESTNAME: ',TESTNAME) if vs.GetObject(TESTNAME) != vs.Handle(0): vs.AlrtDialog('Object with Name '+TESTNAME+' already exists') else: break or this: TESTNAME = 'START' while True: TESTNAME = vs.StrDialog('TESTNAME: ',TESTNAME) if vs.GetObject(TESTNAME) != vs.Handle(0): vs.AlrtDialog('Object with Name '+TESTNAME+' already exists') continue break also works. Regards, Letti
-
Hello, this might be just what you are looking for: Regards, Letti
-
Hello, a workaround i really like is to write the Python code for the object directly into one (or more) Marionette nodes. Because than you can easily add control options like sliders and buttons to the OIP of the Marionette node and you can easily convert the self written node into an object (like you did with Marionette networks), while having more control over the script in comparison to creating a Marionette Network. However this workflow might have some downsides that i am not aware of. Regards, Letti
-
Hello, I found this "weird" behaviour of the "Objs by Crit" node: If i create the criteria via the "Objs by Crit" node to search for all objects where the name is equal to an empty string, i get the hint in the criteria configuration menu, that no such objects were found (as expected). However if i run the node i get all objects that do not have names. By the way, the "Name" node does not return any obejcts when given an empty string. Regards, Letti
-
Hello, maybe the data is stored in another record that is also attached to the object. If i want an overview of all the records (as far as i know) that are attached to an object i use the function below (im not sure if this function works with "ForEachObject", but i think you are going to modify this code anyways): def get_all_record_fields(object_handle) -> list: number_of_records_attached_to_object = vs.NumRecords(object_handle) all_record_fields = [] for i in range(number_of_records_attached_to_object): temp_record_handle = vs.GetRecord(object_handle, i + 1) temp_record_name = vs.GetName(temp_record_handle) temp_number_of_fields_in_record = vs.NumFields(temp_record_handle) for j in range(temp_number_of_fields_in_record): temp_field_name = vs.GetFldName(temp_record_handle, j + 1) temp_field_accuracy = vs.GetFldFlag(temp_record_handle, j + 1) temp_field_type = vs.GetFldType(temp_record_handle, j + 1) temp_is_field_empty, temp_is_data_linked = vs.GetRFieldOpt(object_handle, temp_record_name, temp_field_name) temp_field_value = vs.GetRField(object_handle, temp_record_name, temp_field_name) temp_record_field_dict = { "object_handle" : object_handle, "record_name" : temp_record_name, "record_handle" : temp_record_handle, "field_name" : temp_field_name, "field_accuracy" : temp_field_accuracy, "field_type" : temp_field_type, "is_field_empty" : temp_is_field_empty, "is_data_linked" : temp_is_data_linked, "field_value" : temp_field_value } all_record_fields.append(temp_record_field_dict) return(all_record_fields) Regards, Letti
-
Hello, Thank you for confirming and reporting the bug @MullinRJ. Unfortunately i am dealing with nested folder structures of variable sizes and depths, so i think i am going to just wait for the fix. Just out of curiosity, what ist the normal way of accessing the first "folder" (it is not of type folder, which ist 92 i guess) of the ressource manager? I just cant figure out how it is supposed to be done. Regards, Letti
-
Hello, i want to put one ressource folder into another ressource folder of the same ressource type. In VW 2023 i just can use vs.SetParent(folder_1, folder_2) In VW 2024 however VW crashes if i do the same thing. Putting objects into ressource folders works fine in VW 2024, it seems like its just folders that crash VW. Is this a known issue, or am i missing something. I am aware that there is most likely a workarround to this by moving all the contents of the folders to a temporary folder and than creating the folders with nested vs.BeginFolderN and than putting the contents back into the folders, since there is no problem with that, but i would realy like to avoid that. Regards, Letti
-
Hello, there is a type mismatch at the inputs "sRecName" and "sFildName". There the node "Get Record Field" expects to get data of type "string" (aka. text) but what you are giving with the "Name" nodes are objects (data of type handle) that are named "zahl" and "z-wert". These objects dont exist, so there is nothing put into the "Get Record Field" node at these two inputs. I guess what you wanted to do is to use the "String" node instead of the "Name" nodes. By the way, the expected data types of the input or ourput ports of a node is normaly hinted in the name of said port. For example: "hObj" -> is a handle to an object (it can be treated like an object) "sRecName" -> is a string (text) "nX" -> is a number and so on To cut a long story short, here is a corrected version of your Marionette: punkt_schieben_Marionette.vwx Regards, Letti
-
Hello, unfortunately i cant share the file. This is my workarround, however i think it is not a good one: I wrote a script that copies a duplicate of the object to another layer and rotates it, so that its edges are parallel to x, y, z. Then i read the bbox values and put them into a data record and attached it to the original object. I think that this is a bad idea (in general) because the values in the records dont change automatically if the object changes, but in this case the objects dont get changed. Interestingly this script only takes some seconds to run and does not have memory issues at all, even if run multiple times. I wonder why the worksheet script takes so much longer, even if it does the same thing (or even less). Regards, Letti