Jump to content

Letti R

Member
  • Posts

    72
  • Joined

Reputation

54 Excellent

4 Followers

Personal Information

  • Location
    Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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
  2. 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
  3. 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
  4. 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
  5. Hello, thank you for your reply @Tobias Kern. Unfortunately this does not work, because DEPTH gives wrong values. For example, lets say the object has x, y, z of 1, 2, 3. If WIDTH, HEIGHT, DEPTH would give scrambled values like, 2, 3, 1, this would be no problem because i can sort the values for example the way you pointed out. However i get results like 2, 3, 3 or 1, 2, 2 where one value (the value i get from DEPTH) is just wrong. Interestingly the VS function vs.Get3DInfo(obj) seems to always give the correct values. Regards, Letti
  6. Hello, i have a file with thousands of 3d ifc objects that are rotated in all kind of ways in 3d space. Now i want to sort them by their width, depth and height, so that i can sum them up. I tried to use the =WIDTH, = HEIGHT and =DEPTH functions in a worksheet, however the =DEPTH function gives wrong results when the objects are rotated in a specific way. But because i know that in this case the objects dimensions follow this rule x >= y >= z, i wrote a simple WS scipt that uses vs.Get3DInfo(obj) , which gives me the right results for the dimensions and simply sort them by their value. The problem is (apart from the ws beeing very slow, what was expected), that the script uses a lot of ram and even if the script is finished the used ram number of vw wont drop by much until i restart vw and if i run the script again it just adds to the previously used ram. See below the WS Script that im using. def get_xyz(): # infos obj = vs.WSScript_GetObject() choice = vs.WSScript_GetPrmStr(0) if isinstance(choice, str): choice = choice.lower() # script nHeight, nWidth, nDepth = vs.Get3DInfo(obj) # choice if choice == "h": vs.WSScript_SetResReal(nHeight) elif choice == "w": vs.WSScript_SetResReal(nWidth) elif choice == "d": vs.WSScript_SetResReal(nDepth) else: vs.WSScript_SetResStr("Choice error!") # run get_xyz() I think that the best solution would be to try to export the ifc objects (if possible) in a different way, so that the needed values are already attached to some record, but i am wondering if i am doing something wrong regarding the WS script? Regards, Letti
  7. Hello, if you have a simple solid object (e.g. a cube or an extrusion) this could be done by "extracting" the top or the bottom of the solid. But if your solid object gets just a little bit more complicated, for example two different sized cubes that are added together, this is not as straight forward anymore and there would be different ways, that would give different results. You could for example: want to have the bottom of the solid or just the top or the polygon of a section at a given height or all faces that you can see from the top all faces that you can see from the bottom and maybe more... Maybe you can provide us with an example file where you show some solids that you have, aswell as the expected results. Regards, Letti
  8. Hello, Computerworks already wrote a node to convert Symbols into Groups. You can download it here. Regards, Letti
  9. Hello, i think i struggle to undestrand what exactly you want to acchieve, because i think that width and height of the rectangle cant be choosen independently from spacing if the dircles need to fit into the corners like its drawn in the second screenshot. However this is how i would do a Marionette that distributes loci (a point) along a "line" that follows the x direction, when also the number of points that should be on this line are given: And the same Marionette but for the y direction: And a Marionette that combines the x and y direction into a grid (you have to set the "Mix" node to "Cross Reference" in the OIP of the node): Regards, Letti
  10. Hello, Have a Look at this Marionette, maybe this ist what you are looking for. Regards, Letti
  11. Hello, thank you for your reply. This is definitely an error i did not see. Luckily it should be an easy fix. And i am still hoping that someone has a better solution than this. Here is the code for the updated node: @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'n inches to string feet and inches' ) this.SetDescription( 'n inches to string feet and inches' ) #Input Ports n_inches_input = Marionette.PortIn( 0, 'n inches' ) n_inches_input.SetDescription( 'n inches' ) i_round_input = Marionette.PortIn( 9, 'i round inches to' ) i_round_input.SetDescription( "i round inches to" ) #OIP Controls b_zero_input = Marionette.OIPControl( 'ZERO.X -> .X', Marionette.WidgetType.Bool, True) b_zero_input.SetDescription('ZERO.X -> .X') b_half_input = Marionette.OIPControl( '.5 -> 1/2', Marionette.WidgetType.Bool, True) b_half_input.SetDescription('.5 -> 1/2') b_quarter_input = Marionette.OIPControl( '.25 -> 1/4', Marionette.WidgetType.Bool, True) b_quarter_input.SetDescription('.25 -> 1/4') #Output Ports s_output = Marionette.PortOut('s feet and inches (rounded)') s_output.SetDescription( 's feet and inches (rounded)' ) #BEHAVIOR def RunNode(self): #inputs n_inches = self.Params.n_inches_input.value i_round = int(self.Params.i_round_input.value) b_zero = self.Params.b_zero_input.value b_half = self.Params.b_half_input.value b_quarter = self.Params.b_quarter_input.value # script temp_feet_num = int(n_inches // 12) temp_inches_num = round(n_inches % 12, i_round) temp_feet = str(temp_feet_num) temp_inches = str(temp_inches_num) temp_inches = temp_inches.rstrip(".0") if b_zero: temp_inches = temp_inches.lstrip("0") if b_half: if temp_inches[-2:] == ".5": temp_inches = temp_inches[:-2] + " 1/2" if b_quarter: if temp_inches[-3:] == ".25": temp_inches = temp_inches[:-3] + " 1/4" elif temp_inches[-3:] == ".75": temp_inches = temp_inches[:-3] + " 3/4" temp_feet = temp_feet + "'" temp_inches = temp_inches + '"' temp_output = temp_feet + temp_inches if temp_inches_num == 0: temp_output = temp_feet if temp_feet_num == 0: temp_output = temp_inches temp_output = temp_output.strip() #outputs self.Params.s_output.value = temp_output Please note that i also set the default value of "i round inches to" to 9 decimal places. This should eliminate most errors that occur due to floating point inaccuracies whilst beeing precise enough. But you can ofcourse set the value to what you need. Also please note that i only tested this node while the document units were set to "feet and inches". If you use some other setting like "feet" the return value of the node will be wrong because the input will most likely not be in inches (the input number has to be in inches). Ofcourse i could write the node so that i checks the current unit settings of the document and converts what ever the input is into feet and inches, but i hope that i can avoid that for it would take some time. Regards, Letti
  12. Hello, i had a bit of fun with this problem and wrote a custom node that converts a number that is given in inches to a string that is in feet and inches. Because i dont know anything about imperial units i just tried to replicate what is shown in the OIP of the "Dim" node. But you can chose if you want to display .5" as 1/2" or as .5" (same with .25" and .75") in the OIP of the custom node via two checkboxes. I realy hope that this custom node is not necessary and that someone will show an easier (built-in) way, but until then this node should be a good workarround. To create the node just go into any node and replace the whole code with the code provided below. Please test the node and make sure that it works as intended! @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( 'n inches to string feet and inches' ) this.SetDescription( 'n inches to string feet and inches' ) #Input Ports n_inches_input = Marionette.PortIn( 0, 'n inches' ) n_inches_input.SetDescription( 'n inches' ) i_round_input = Marionette.PortIn( 0, 'i round inches to' ) i_round_input.SetDescription( "i round inches to" ) #OIP Controls b_zero_input = Marionette.OIPControl( 'ZERO.X -> .X', Marionette.WidgetType.Bool, True) b_zero_input.SetDescription('ZERO.X -> .X') b_half_input = Marionette.OIPControl( '.5 -> 1/2', Marionette.WidgetType.Bool, True) b_half_input.SetDescription('.5 -> 1/2') b_quarter_input = Marionette.OIPControl( '.25 -> 1/4', Marionette.WidgetType.Bool, True) b_quarter_input.SetDescription('.25 -> 1/4') #Output Ports s_output = Marionette.PortOut('s feet and inches (rounded)') s_output.SetDescription( 's feet and inches (rounded)' ) #BEHAVIOR def RunNode(self): #inputs n_inches = self.Params.n_inches_input.value i_round = int(self.Params.i_round_input.value) b_zero = self.Params.b_zero_input.value b_half = self.Params.b_half_input.value b_quarter = self.Params.b_quarter_input.value # script temp_feet = str(int(n_inches // 12)) temp_inches = str(round(n_inches % 12, i_round)) temp_inches = temp_inches.rstrip(".0") if b_zero: temp_inches = temp_inches.lstrip("0") if b_half: if temp_inches[-2:] == ".5": temp_inches = temp_inches[:-2] + " 1/2" if b_quarter: if temp_inches[-3:] == ".25": temp_inches = temp_inches[:-3] + " 1/4" elif temp_inches[-3:] == ".75": temp_inches = temp_inches[:-3] + " 3/4" temp_output = temp_feet + "'" + temp_inches + '"' if temp_feet == "0": temp_output = temp_inches + '"' temp_output = temp_output.strip() #outputs self.Params.s_output.value = temp_output Regards, Letti
  13. Hello, when you use the "Dim" node with "feet and inches" it converts the input to inches. I think the zeroes are due to conversion error. To get rid of them you just can use the "round" node to round the value to the desired ammount of digits. As someone who never uses imperial units i dont know if there is an easy solution (in Marionette with no custom nodes) if you want to show your dimensions in feet and inches combined. However here is a Marionette that puts together a string with the three dimensions all in inches: Regards, Letti
  14. Hello, you can find a node that gives you the name of a symbol in this file, that @DomC shared. It is in the "Object Info" column. However, there are other ways to replace symbols without the use of Marionette. Here is my preferred way of doing it: Select the Option "Symbol name" in this Tool Set all layers you want to search the symbol in to show Select the option "Show/Snap/modofy Others" for the leyers Click on one symbol with the Tool shown above Replace the symbols with the correct one via the "Replace" button in the object info palette. Regards, Letti
  15. Hello, changing the z-value of a 3d locus can be done with Marionette. Unfortunately i am not familiar with the "Text to loci" network that you are referring to, so i dont know if my example network is a good solution, but maybe you can point me in the right direction. This is how such a Marionette could look like: The Marionette works like this: At first it searches for all the 3D loci with the "Objs by Crit" node Then it gets the location of each found locus and finds its x, y and z values Then it does something to the z value (in this case i divided the z value by 10) After that the Network puts the coordinate values back together in the "Point 3D" node And finally sets the coordinates of the 3D locus to the new values Regards, Letti
×
×
  • Create New...