Karamba - Python - Grasshopper2024-03-28T22:39:30Zhttps://www.grasshopper3d.com/forum/topics/karamba-python?groupUrl=karamba3d&commentId=2985220%3AComment%3A1880321&groupId=2985220%3AGroup%3A251211&feed=yes&xn_auth=nook I finally understood
for…tag:www.grasshopper3d.com,2018-05-03:2985220:Comment:19071542018-05-03T10:35:50.256ZGiovanni Inghiramihttps://www.grasshopper3d.com/profile/GiovanniInghirami
<p>ok I finally understood</p>
<p></p>
<p></p>
<p><strong>for</strong> node <strong>in</strong> inModel.nodes:<br/> <strong>print</strong> node.pos</p>
<p></p>
<p>I understood that there are some words not defined that work, now I'm beginning to do what I want and to work with 'Field' and 'Properties'.</p>
<p></p>
<p>Thanks anyway</p>
<p>Best</p>
<p>Giovanni</p>
<p>ok I finally understood</p>
<p></p>
<p></p>
<p><strong>for</strong> node <strong>in</strong> inModel.nodes:<br/> <strong>print</strong> node.pos</p>
<p></p>
<p>I understood that there are some words not defined that work, now I'm beginning to do what I want and to work with 'Field' and 'Properties'.</p>
<p></p>
<p>Thanks anyway</p>
<p>Best</p>
<p>Giovanni</p> Hi Clemens,
you're right I fo…tag:www.grasshopper3d.com,2018-05-02:2985220:Comment:19069312018-05-02T15:04:31.787ZGiovanni Inghiramihttps://www.grasshopper3d.com/profile/GiovanniInghirami
<p>Hi Clemens,</p>
<p>you're right I forgot to input a node object, but however I don't understand how to use it. I tried in different ways.</p>
<p></p>
<p>As I said above I've already download the <span>'Karamba 1.1.0 Hacker's Essentials' but I don't find the python syntax in the 'Karamba110_HackersGuide' or samples of python scripting. </span><span>There is only the example 'SimpleShellEso' but I can not figure out how to do it in my case.</span></p>
<p></p>
<p>I just asking how to get xyz…</p>
<p>Hi Clemens,</p>
<p>you're right I forgot to input a node object, but however I don't understand how to use it. I tried in different ways.</p>
<p></p>
<p>As I said above I've already download the <span>'Karamba 1.1.0 Hacker's Essentials' but I don't find the python syntax in the 'Karamba110_HackersGuide' or samples of python scripting. </span><span>There is only the example 'SimpleShellEso' but I can not figure out how to do it in my case.</span></p>
<p></p>
<p>I just asking how to get xyz coordinates of my model nodes.</p>
<p></p>
<p>So maybe I could understand how to use 'Fields' and 'Properties' of the classes for what I need.</p>
<p></p>
<p>Cheers</p>
<p>Giovanni</p> Hi Giovanni,
in the above cod…tag:www.grasshopper3d.com,2018-05-01:2985220:Comment:19068172018-05-01T19:15:29.852ZKaramba3Dhttps://www.grasshopper3d.com/profile/karamba
<p>Hi Giovanni,</p>
<p>in the above code-snippet you seem to forget to input a node object.</p>
<p>Maybe it helps if you take a look at the 'Karamba 1.1.0 Hacker's Essentials' (see above).</p>
<p>For a basic introduction into Python please consult a text book or on-line resources (e.g. sourceforge).</p>
<p>Best,</p>
<p>Clemens</p>
<p></p>
<p></p>
<p>Hi Giovanni,</p>
<p>in the above code-snippet you seem to forget to input a node object.</p>
<p>Maybe it helps if you take a look at the 'Karamba 1.1.0 Hacker's Essentials' (see above).</p>
<p>For a basic introduction into Python please consult a text book or on-line resources (e.g. sourceforge).</p>
<p>Best,</p>
<p>Clemens</p>
<p></p>
<p></p> Hi Clemens,
Thank you for th…tag:www.grasshopper3d.com,2018-04-27:2985220:Comment:19062372018-04-27T08:17:15.039ZGiovanni Inghiramihttps://www.grasshopper3d.com/profile/GiovanniInghirami
<p>Hi Clemens,</p>
<p></p>
<p>Thank you for the answer.</p>
<p>I searched 'pos' in the Guide and I find it in 'Fields' of 'Node Class'.</p>
<p>In the GHPyhton component after connecting 'Pt' from a 'Disassemble model' I write:</p>
<p></p>
<p>"import clr</p>
<p>clr.AddReferenceToFileAndPath("C:\Program Files (x86)\Rhinoceros 5\Plug-ins\Karamba.gha")</p>
<p>import Karamba.Nodes.Node as Node</p>
<p>print Node.pos"</p>
<p></p>
<p>but returns printed <field# pos on Node>.</p>
<p>How can I…</p>
<p>Hi Clemens,</p>
<p></p>
<p>Thank you for the answer.</p>
<p>I searched 'pos' in the Guide and I find it in 'Fields' of 'Node Class'.</p>
<p>In the GHPyhton component after connecting 'Pt' from a 'Disassemble model' I write:</p>
<p></p>
<p>"import clr</p>
<p>clr.AddReferenceToFileAndPath("C:\Program Files (x86)\Rhinoceros 5\Plug-ins\Karamba.gha")</p>
<p>import Karamba.Nodes.Node as Node</p>
<p>print Node.pos"</p>
<p></p>
<p>but returns printed <field# pos on Node>.</p>
<p>How can I print that property correctly?</p>
<p></p>
<p>And an other question. I noticed that every class have 'Fields' and 'Properties'. They seems me quite similar, such as a kind of classes information.</p>
<p>What's the difference? I can get the information by 'Properties' like for the 'Fields'?</p>
<p></p>
<p>Sorry if the questions are too simple</p>
<p>Cheers</p>
<p></p>
<p>Giovanni</p> Hi Giovanni,
the 'Node'-class…tag:www.grasshopper3d.com,2018-04-26:2985220:Comment:19060422018-04-26T18:30:39.072ZKaramba3Dhttps://www.grasshopper3d.com/profile/karamba
<p>Hi Giovanni,</p>
<p>the 'Node'-class possesses the public property 'pos' which returns the initial position of a node. The property 'ind' gives you the index of the node.</p>
<p>Best,</p>
<p>Clemens</p>
<p></p>
<p>Hi Giovanni,</p>
<p>the 'Node'-class possesses the public property 'pos' which returns the initial position of a node. The property 'ind' gives you the index of the node.</p>
<p>Best,</p>
<p>Clemens</p>
<p></p> Hi Merijin,
I write here beca…tag:www.grasshopper3d.com,2018-04-26:2985220:Comment:19059972018-04-26T13:53:55.760ZGiovanni Inghiramihttps://www.grasshopper3d.com/profile/GiovanniInghirami
<p>Hi Merijin,</p>
<p>I write here because I'd want to do your same process but passing from a .txt file.</p>
<p>I'm a very beginner of programming and I'm trying to use the GHPython component for write the model-info in a .txt file, but I don't understand how to do it.</p>
<p>I think the main problem is that I don't know how to get the informations. I downloaded the 'karamba_1_1_0_hackers_essentials' (linked above by Clemens) but in the Guide I don't find the python syntax.</p>
<p>For example…</p>
<p>Hi Merijin,</p>
<p>I write here because I'd want to do your same process but passing from a .txt file.</p>
<p>I'm a very beginner of programming and I'm trying to use the GHPython component for write the model-info in a .txt file, but I don't understand how to do it.</p>
<p>I think the main problem is that I don't know how to get the informations. I downloaded the 'karamba_1_1_0_hackers_essentials' (linked above by Clemens) but in the Guide I don't find the python syntax.</p>
<p>For example I'd want to write in the GHPython component something that allow me to write for every node " 'Node' + str(ID) + str(XYZcoordinates)". I think I have to find a karamba function that gets the nodes coordinates, but I don't find it. I saw that there is a 'Displacement vector of the node' but I'm not able to call it.</p>
<p>I'm not sure, but I think that's the way that allow me to be able to get the informations and write it how I want.</p>
<p>I'm thinking wrong?</p>
<p>There is an easy way?</p>
<p></p>
<p>Cheers</p>
<p></p>
<p>Giovanni</p> Hi Clemens,
Thanks a lot! as…tag:www.grasshopper3d.com,2018-01-24:2985220:Comment:18803552018-01-24T10:02:40.081ZMerijn de Leurhttps://www.grasshopper3d.com/profile/MerijndeLeur
<p>Hi Clemens,</p>
<p></p>
<p>Thanks a lot! as always!</p>
<p></p>
<p>Best,</p>
<p></p>
<p>Merijn</p>
<p>Hi Clemens,</p>
<p></p>
<p>Thanks a lot! as always!</p>
<p></p>
<p>Best,</p>
<p></p>
<p>Merijn</p> Hi Merijn,
you can access the…tag:www.grasshopper3d.com,2018-01-23:2985220:Comment:18803212018-01-23T19:46:32.532ZKaramba3Dhttps://www.grasshopper3d.com/profile/karamba
<p>Hi Merijn,</p>
<p>you can access the Karamba functionality via Python and IronPython. Both ways are described in the 'Karamba 1.1.0 Hacker's Essentials' (see <a href="http://www.karamba3d.com/download/hackers-essentials-2/?wpdmdl=4348&masterkey=57c463c0097d1" target="_blank">http://www.karamba3d.com/download/hackers-essentials-2/?wpdmdl=4348&masterkey=57c463c0097d1</a>). The manual is not up to date, however you can use ILSpy to decompile 'karamba.gha' in order to see how it…</p>
<p>Hi Merijn,</p>
<p>you can access the Karamba functionality via Python and IronPython. Both ways are described in the 'Karamba 1.1.0 Hacker's Essentials' (see <a href="http://www.karamba3d.com/download/hackers-essentials-2/?wpdmdl=4348&masterkey=57c463c0097d1" target="_blank">http://www.karamba3d.com/download/hackers-essentials-2/?wpdmdl=4348&masterkey=57c463c0097d1</a>). The manual is not up to date, however you can use ILSpy to decompile 'karamba.gha' in order to see how it works. </p>
<p>The MeshLoad-component is converted to point-loads on nodes and uniformly distributed loads on beams and trusses via the Assemble-component.</p>
<p>Using ILSpy you will see that there is a class 'Component_AssembleModel' and a class 'Component_AssembleModel_GUI'. The former performs the acutal task via the static method solve(), the latter provides the visual component. The easiest way to get the information from a MeshLoad would be to initiate the assemble process and then retrieve the load-data from the model.</p>
<p>Best,</p>
<p>Clemens</p>
<p></p>
<p></p>