d the ObjectName of a selected set of objects from a Rhino model in CSV format.
2) Opened this in Excel, Column-A contains the GUID, Column-B contains ObjectNames.
3) Modified and revised the ObjectNames in Excel.
4) Using another GH-solution, Wrote a VB script to push this modified data back into the model. However after baking, the objectName is not getting updated.
Though the solutions do not show any runtime errors, after baking, the ObjectNames are not updated. However, if I try selecting the object using:
obj.Select < - this gives an error
--------------------------------------------------------
Here is the code to my GH-solution (see attached image)
WriteToXL module:
------------------------------------------------------------------------------
Private Sub RunScript(ByVal id As Object, ByRef mName As Object, ByRef GUID As Object, ByRef A As Object) Dim obj As Rhino.DocObjects.RhinoObject = doc.Objects.Find(id)'Dim A As StringDim mP1(2) As DoubleDim mP2(2) As DoubleDim mCurve As Rhino.DocObjects.CurveObjectIf obj Is Nothing ThenmName = "Obj not found"ElseIf obj.ObjectType = Rhino.DocObjects.ObjectType.Curve ThenmCurve = objmP1(0) = mcurve.CurveGeometry.PointAtStart.XmP1(1) = mcurve.CurveGeometry.PointAtStart.YmP1(2) = mcurve.CurveGeometry.PointAtStart.Zmp2(0) = mcurve.CurveGeometry.PointAtEnd.Xmp2(1) = mcurve.CurveGeometry.PointAtEnd.Ymp2(2) = mcurve.CurveGeometry.PointAtEnd.ZEnd IfmName = CType(obj.Name, String)GUID = obj.idA = GUID.ToString & ", " & CStr(mName) & ", " & mp1(0) & ", " & mp1(1) & ", " & mp1(2) & ", " & mp2(0) & ", " & mp2(1) & ", " & mp2(2)End IfEnd Sub -------------------------------------------------------
ReadFromXL module:
-------------------------------------------------------
Private Sub RunScript(ByVal activate As Object, ByRef A As Object, ByRef B As Object, ByRef C As Object) If activate = True Then Dim XLApp As Object Dim XLSheet As Object
xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application") Dim strSheet As String = "ObjectName+GUID" XLSheet = xlApp.Worksheets(strSheet)
Dim strGUIDColumn As String = "A" Dim strObjectNameColumn As String = "L"
Dim iRow As Int16 Dim nRows As Int16 = XLSheet.usedrange.rows.count Dim obj As Rhino.DocObjects.RhinoObject ReDim B(nRows - 1) ReDim C(nRows - 1) ReDim A(nRows - 1) For iRow = 1 To nRows
Dim strGUID As String = XLSheet.Range(strGUIDColumn & iRow).Value Dim objGUID As Guid = New System.Guid(strGUID) Dim strObjectName As String = XLSheet.Range(strObjectNameColumn & iRow).Value obj = doc.Objects.Find(objGUID) obj.Attributes.Name = strObjectName B(iRow - 1) = objGUID C(iRow - 1) = obj.Attributes.Name A(iRow - 1) = obj Next
End If
End Sub
----------------------------------------------------------------…
n the world of programming. With that assumption, I would recommend following resources;
1. thenewboston
2. Think Python
3. Codecademy Python course
4. MIT OCW
I would like to offer an analogy here to make a point as to why learning to code is important for anyone regardless of profession or industry. It is my observation that packaged software tend to influence problem-solving methods. For instance, if one's using excel for data analysis, there's a good chance that excel will influence one's problem-solving approach. One will only think about running analysis that is possible in excel. If we let a packaged software influence our inquiry, that's not good in my opinion.
So I think of packaged software as packaged food. We can't have it all the time. At some point, we need to learn to cook. That's programming.
Learning to code will also make it very easy for you to work with the best minds in the world. So keep doing a little bit at a time and you will pick it up very soon.
I am no expert by any measure. But I would highly recommend following people like Mostapha. He was also trained as an architect in Iran. With his work, he has made a tremendous contribution to this industry(Read - "Changed the world").
Hope this helps.
Best,
-Devang…
hes with 5 values in each (but they can as well be many more branches and values). So I what I want is to make a list with one branch where the values for "1", "2", etc. from both branches will be summer up.
The attached picture show how it is done by exporting the values to excel and then importing them back to GH. However, I am looking for a more flexible way to do that.
Please share some suggestions
Mihail…
and import(or open) that .csv as "Text". And then you can choose semicolon as separator.
3. You can get the explanation of all input from [Material Properties] component. I'll write down below.
E (Number) Young's Modulus [kN/cm2] of the material.
G (Number) Shear Modulus [kN/cm2] of the material.
gamma (Number) Specific weight [kN/m3] of material.
alphaT (Number) Coefficient of thermal expansion [1/C°] of the material.
fy (Number) Yield strength [kN/cm2] of the material.
Name (Text) Name of the material.
Best,…
思った感じになりません。
balls の代わりにplanarカーブを直接入れてみましたがエラーが出ます。
ファンクションにしてみたところ、forループので作った数値が反映されていません。
ファンクションのインスタンス?を出力していないと思い上記のようにしましたがエラーが出てしまいます。
以上の事から自分の認識が正しいのかよくわからなくなりました・・・
python自体の深いところをわかっているわけではないので余計こんがらがりました。
そこで、for b in ballsはどのような条件または使い方であれば使えるのでしょうか?
そして、上記のように別のオブジェクトに対しての使い方はどのようにすればできるのでしょうか?
2:同じファンクション内のdist = rs.Distance(self.pos,b.pos)についてですが
この文章も for b in balls によってbはBallのインスタンスであると定義?されたためb.posがbの位置であると分かるのでしょうか?
pythonは定義しなくても動いてしまうのでどのような時に使えるのか文章見ただけではよくわかりません・・・
大変細かいことかもしれませんが、よりpythonをしっかりと理解するためにも、どなたかわかる方ご教授いただけると幸いです。…
icroclimate Map is this time "Solution exception:index out of range: 0". But with the origin csv it works fine.
Do you know why there is this error ?
I thought to create a new csv file thanks to Honeybee_Create CSV Schedule. But I have this error (the Python Script Editor multiplies the radTempMtx per 2) :
…
processes to explore 1000's of design possibilities. What we see now, is generative models that are driven by the designer - with the exception of Galapagos - which selects designs based on fitness functions. So we have not entered a phase where we are using computers to creatively explore design possibilities. Now, when we do that we face some real problems.
1) Too much designs (can be in the millions)
2) There generated designs can be too similar to each other.
3) Unquantifiable nature of the goodness of the generated designs
Genoform is designed to addresses these issues. These issues are generally not faced if the design exploration is driven manually. They will be faced once they are generated by the computer.
The current version of Genoform addresses only the generation part. The future versions will address the selection part. But advanced users may use the Excel table to develop their own selection methods - that will be required in generative schemes.…
.
(2) You do not need to reference the dll. By using the code you copied into the "<costum additional code>" region the dll is loaded via the command "[DllImport("St7API.dll")]". However this means that you will need to reference the path of the dll in your environmental variables. (found in control panel - advanced system settings - environmental variables - path, at least on my computer)
Hope that helps.…
Added by Sam Gregson at 3:31am on December 14, 2017
can not open them, he says: "file read failed".
Is it possible that it is because I work with the updated version of Pachyderm in September 2017? (and not the last one I saw you put in December 2017?).
If not, what can it be?
Thank you again,
Kind regards
Giulia…