David O Posted May 23, 2018 Share Posted May 23, 2018 Hello Marionette lovers ! Is there anyway using existing nodes to convert strings (like the ones coming from the GetIFC Pset Value ... and many others from IPFC parameters...) into a number or Integer ? Maybe the node Function could do this trick ? (but was not capable to implement this properly ...) ? Thanks for your valued inputs ! Quote Link to comment
Marionette Maven Marissa Farrell Posted May 23, 2018 Marionette Maven Share Posted May 23, 2018 If the string is composed of entirely numbers, you can run it through the "float" node. It's a little trickier if you have units in the string, though, and those would require special handling. Quote Link to comment
David O Posted May 23, 2018 Author Share Posted May 23, 2018 Ok... got it. Tks Marissa ! Yes... i think that in case we do have units involved we better trying creating a custom node and do things in Python instead ... right ? Quote Link to comment
DomC Posted May 27, 2018 Share Posted May 27, 2018 I would take the Function Node and use the formula x[:-2] (to remove the last to items of the string, or x[:-1] to remove the last one etc.). There will be other possibilities with other nodes but I first had to search the right ones. Quote Link to comment
David O Posted May 29, 2018 Author Share Posted May 29, 2018 Yeah, that worked too ... Thanks Dom ! Quote Link to comment
ThomasE Posted March 6, 2019 Share Posted March 6, 2019 Hello DomC How does it work ? Can I use it in the Datenmanager ? I would like to display 0.30 instead of 0.30000000 Thank you for your Help Quote Link to comment
ThomasE Posted March 6, 2019 Share Posted March 6, 2019 Do I make something wrong ? Quote Link to comment
ThomasE Posted March 6, 2019 Share Posted March 6, 2019 I try in Node area = vs.Round(vs.GetObjectVariableReal(obj,608)/0.01) * 0.01 by doing *0.01 the zeros come again.... Quote Link to comment
DomC Posted March 6, 2019 Share Posted March 6, 2019 Hi Generally this are common issues: 1. If you have a String of 0.30000 and want to have have a string output from 0.30 you can youse x[:4]. The first 4 character of the string. If you have 100.45987 you will get 100. with this formula. If you use x[:-2] the last two characters are lost. To Prevent this, you could first split the string in number and digit and then operate with this. 2. Sometimes there are Units like m2 mm m qm etc. 3. Sometimes we want to have prefix like +. - and +- etc. 4. Sometimes there are , instead . of decimal seperators. The attached Nodes, addresses all of this common issues. Simple issues, but relatively complexe to solve. I attached some node to solve them. The error message you got is because to substract two items from a list (a string is like a list '0', '.', '0', '0' etc. or a list of numbers will be [0,5,3,4.5,]). So with a Number of 0.30000 it will not work, this is just one item. You could convert to string str(x)[:-2]. Then it would work. Do not know what mapping is doing. If it converts the string of 0.3 in a number it Maybe by standard makes again 0.300000 in the IFC Export. You see, not so trivial. I Recommend using the Attached Node Digits from string and try with this. Set Digits From String.vwx 1 Quote Link to comment
ThomasE Posted March 11, 2019 Share Posted March 11, 2019 Thank you very much for your help... I have another question: How can I use the Node "Objs by Crit" for a Column ? PON='Column' or T=Column PON='Säule' doesn't work... The same question for a Door / Window / Fassade !? Thank you so much for your Help... Quote Link to comment
Marionette Maven Marissa Farrell Posted March 11, 2019 Marionette Maven Share Posted March 11, 2019 @Thomas Gillioz In 2019, the Objects by Criteria node has a button below it allowing you to define the Criteria using a dialog. When I placed a column in my document and used that button, I was given ((PON='Column2')) as my criteria. If you are not seeing the button in the Object Info Palette with the Objs by Crit node selected, please replace the existing node with a new one from default content. Quote Link to comment
ThomasE Posted March 11, 2019 Share Posted March 11, 2019 Thanks a lot, That will make my life easier 😃 Regards Quote Link to comment
ThomasE Posted March 11, 2019 Share Posted March 11, 2019 it's me again, 😃 How can I create a node with object.OA Height Shaft Depth Shaft Width ?? Thanks a lot Quote Link to comment
Marionette Maven Marissa Farrell Posted March 11, 2019 Marionette Maven Share Posted March 11, 2019 Here's a short network that returns these values. Often, values for Parametric Objects are stored in hidden records - this demonstrates how to extract the ones you've asked for. Record fields are returned as strings (text), so they will need to be converted to numbers if you plan to use them elsewhere. If you want to assign values to the object, you would instead use the Set Record Field node. Marionette_ReturnColumnInfo_MFarrell.vwx 1 Quote Link to comment
ThomasE Posted March 11, 2019 Share Posted March 11, 2019 Thank you for your quick reply and how do you convert String to Numbers ? so could I use the div node... I need the 0.25 instead of 2.5e-01m or 2.5 Quote Link to comment
ThomasE Posted March 11, 2019 Share Posted March 11, 2019 sorry I found the "Float" node... Thanks again for your Help !! Quote Link to comment
ThomasE Posted May 4, 2021 Share Posted May 4, 2021 Hello, I'm here again. @Marissa Farrell @DomC I need your help. I have an Issue with the opening in the wall of doors. If I take the values of *Door CW*, the result is with e-01m or e00m as unit. If I split the unit from number, the information is lost. For example 9.2e-01m should be 0.92m 1.02e00m should be 1.02m In my marionette node, the result is 9.2 and 1.02 and not 0.92 and 1.02... How can I find a solution for that, or where can I find the opening height and lenght of the wall opening from a door ? Quote Link to comment
DomC Posted May 4, 2021 Share Posted May 4, 2021 (edited) Hi I think you could do the following: 1. Switch off unit in the document settings 2. Or modify the the Node "split unit from number" as following: ',' also fix the issue, when this node is used in Countries with ',' as a decimal separator. If we anytime had the possibility for voting for small things like this. Please all vote for decimal units and all vote for point as decimal delimiter. 🙂 Edited May 4, 2021 by DomC 1 Quote Link to comment
ThomasE Posted May 4, 2021 Share Posted May 4, 2021 hello DomC, Thank you for your quick reply, but I can't see any Image. Can you re-upload the image ? Thanks a lot Quote Link to comment
ThomasE Posted May 4, 2021 Share Posted May 4, 2021 (edited) 😍 It's working !!! Thanks a lot ! Regards & Merci vielmals I definitely need to learn thy python language Edited May 4, 2021 by Thomas Gillioz Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.