000 holes). I worked for half an hour to divide the 50 rows in z direction into 50 groups where each one is responsible of calculating 300 holes in x-direction.
Even though each group calculates 300 holes, it still takes longer time for every group. The time increase is linear, why the first 300 holes takes 15 seconds the next 300 takes 75 seconds, next group of 300 holes takes 134 seconds and so on. The last group (group nr. 50) should take 3000 seconds to calculate. I don't know if it should be like this, even though we have divided them in smaller fractions??
Based on that I made a function in Excel that approximated this new definition to get calculated in 21 hours (@ 3,5Ghz). It will take slightly longer as I only use 2,7Ghz during work hours, meaning it will take up to 30 hours. But far better than weeks, which I now realize could be the case with the definition I was working on before.
Think this is the optimal solution for now.
Will let you know how it goes. Thank you again Marco!
Yours,
Andreas…
lass BrepDeform Inherits GH_Component Public Reslist As New List(Of String) Public Sub New() MyBase.New("BrepDeform", "Deform", _ "移动物件的控制点" & vbCrLf & "(Move the control Point to change a object)", "SEG", "Modify")
End Sub Public Overrides ReadOnly Property ComponentGuid As System.Guid Get Return New Guid("8226e0ea-ed6b-47c2-8a24-244f044152d8") End Get End Property Protected Overrides ReadOnly Property Internal_Icon_24x24() As System.Drawing.Bitmap Get Return My.Resources.SEG_BrepDeform End Get End Property Protected Overrides Sub RegisterInputParams(ByVal pManager As GH_Component.GH_InputParamManager) ' pManager.AddTextParameter("Guid", "Id", "将要被替换的犀牛物件" & vbCrLf & "(RhinoObjects that will be replaced)", GH_ParamAccess.item) 'Dim guidParam As New Param_Guid pManager.AddParameter(New Param_Guid, "Guid", "Id", "将要被替换的犀牛物件" & vbCrLf & "(RhinoObjects that will be replaced)", GH_ParamAccess.item) pManager.AddPointParameter("ControlPoint3d", "C", "控制点的位置" & vbCrLf & "(Control Point's location)", GH_ParamAccess.item) pManager.AddPointParameter("NewPoint3d", "P", "新控制点的位置" & vbCrLf & "(New Control Point's location)", GH_ParamAccess.item) pManager.AddNumberParameter("Tolerace", "T", "输入点与物件实际控制点对比的精度" & vbCrLf & "(Tolerace for the Control Point match)", GH_ParamAccess.item, 0.1)
pManager.AddBooleanParameter("BlMove", "M", "如果是True则进行移动" & vbCrLf & "(If true Perform the Move)", GH_ParamAccess.item, False)
End Sub Protected Overrides Sub RegisterOutputParams(ByVal pManager As Kernel.GH_Component.GH_OutputParamManager) pManager.AddTextParameter("Result", "RG", "结果列表" & vbCrLf & "(Result)", GH_ParamAccess.list) End Sub Public Overrides ReadOnly Property Exposure As GH_Exposure Get Return GH_Exposure.primary End Get End Property
Protected Overrides Sub SolveInstance(ByVal DA As Kernel.IGH_DataAccess) If Banner.astrict.showmessage Then Return Dim Ids As Guid = Guid.Empty 'Dim Ids As String = String.Empty Dim tpt As Point3d = Point3d.Unset, opt As Point3d = Point3d.Unset Dim tolar As Double = 0.1 Dim blMove As Boolean = False If Not DA.GetData(0, Ids) Then Return If Not DA.GetData(1, opt) Then Return If Not DA.GetData(2, tpt) Then Return If Not DA.GetData(3, tolar) Then Return If Not DA.GetData(4, blMove) Then Return If Not blMove Then GoTo line1 Reslist.Add(Now & "_未替换!(Replace failed!)") Else Reslist.Clear() ' Grasshopper.Instances.ActiveCanvas.ModifiersEnabled = False End If
' rt.AddRange(docobjlist.Select(Function(geoobj As RhinoObject) GH_Convert.ObjRefToGeometry(New ObjRef(geoobj.Id)))) 'Private Checked(5) As Boolean, Namestr() As String = {"Point", "Curve", "Brep", "Mesh", "TextDot", "TextEntity"}
Try
Dim rh As RhinoDoc = Rhino.RhinoDoc.ActiveDoc Dim rhobj As RhinoObject = rh.Objects.Find(Ids) ' Dim rhobj As RhinoObject = rh.Objects.Find(New Guid(Ids))
Dim bobj As BrepObject = CType(rhobj, BrepObject) RhinoApp.RunScript("Cancel", False) RhinoApp.RunScript("Cancel", False) bobj.Select(True)
RhinoApp.RunScript("_SolidPtOn", False) Dim gobjs As GripObject() = bobj.GetGrips ' rh.Views.RedrawEnabled = False For Each grpobj As GripObject In gobjs
If grpobj.CurrentLocation.DistanceTo(opt) < tolar Then grpobj.Select(True) Dim CurrentPln As Plane = RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewport.ConstructionPlane Dim tropt As New Point3d(opt), trtpt As New Point3d(tpt) tropt.Transform(Transform.PlaneToPlane(Plane.WorldXY, CurrentPln)) trtpt.Transform(Transform.PlaneToPlane(Plane.WorldXY, CurrentPln))
Dim movestr As String = "_move " + String.Format("{0},{1},{2} ", tropt.X, tropt.Y, tropt.Z) + String.Format("{0},{1},{2} _Cancel _Cancel", trtpt.X, trtpt.Y, trtpt.Z) RhinoApp.RunScript(movestr, True) grpobj.Select(False) End If
Next
'RhinoApp.RunScript("Cancel", False) 'RhinoApp.RunScript("Cancel", False) '' rh.Views.RedrawEnabled = True Reslist.Add(Now & "_替换成功!(Replace Success!)") Catch ex As Exception Reslist.Add(Now & "_替换失败!(Replace failed!)" & vbCrLf & ex.Message)
End Try ' Grasshopper.Instances.ActiveCanvas.ModifiersEnabled = True
line1: DA.SetDataList(0, Reslist) End Sub
'Private Sub Testt_PingDocument(sender As IGH_DocumentObject, e As GH_PingDocumentEventArgs) Handles Me.PingDocument ' Dim Mbool = Aggregate bcbool In Checked Into cb = Any(bcbool)
' If Not Mbool Then ' Checked(0) = True ' Message = Namestr(0) ' Order = 0 ' End If 'End Sub
End Class
The picture below shows the two question.
Question One I must use data dam, or the component can't batch deal the brep. I don't know why, I have You can give me a solution to make it working normal not using the data dam
Question Two I can not uset the Button component, If I use it, the gh canvas will die with some mouse event--. I have see this problem before in this forum,but there is no solution and explain. I want to know why and How to solve it.
I don't know if I have made my question clear,if not give a message. Thank you! Thank you all.
The gh test file and 3dm test file in the upload files.
…
el X. If - at any point during the day - the average illuminance exceeds X, then the blinds are closed. The blinds only have two opportunities to reopen during the day: First thing in the morning and right after lunch (since people probably won't be experimentally opening the windows every hour).
For bonus points, it would be nice to add a further detail. I'd like to assume that the blinds will be closed if either of two conditions are met. 1) the average illuminance exceeds X and 2) the illuminance at any sensor point exceeds Y.
It can be done in excel - but would be cooler/quicker to do the whole thing in Grasshopper.
Thanks much!
-John…
not linear. I need to get the coordinates of every line, say 2 mm increments in length, so that I can 3D print this shape. Here is a model that I've created just to clarify the subject:
Here is the question, how can I get the x, y and z coordinates and implement them into notepad or excel or something else? The important thing is the increments should be by length.
Thanks to community in advance.…
e it would of course be amazing if these could be displayed in a Rhino window / baked as objects...). I use the BarGraph as a histogram constantly for exploring the data I generate as I'm designing - in fact the graph components are one of the most frequent components I use at the 'end' of my design process. Would be nice to add Titles to the graph/bargraph and labels to axes, as well as the feature requests Marc points out above.
Also wondered if the 'MD slider' would soon have a 3D option similar to the colour picker? Would be useful.
Of course many other graph types would come in quite handy (I often export my data to Excel in order to visualise better) - 2D scatter with the tree structure indicating different data sets and therefore different colour/point types on the graph (Excel-style) would be handy. Of course these could be created as Grasshopper objects and displayed in the viewport but I find the work needed to get to a presentable output this way is often too much and its faster for me to just look at the data in Excel. Also in the Rhino viewport you often want to be visualising the end result of your definition (i.e. geometry) and not have to zoom somewhere else or fiddle around to try to display a graph of values at the same time. I could imagine an 'output' control panel could be quite handy, where you drag and lock in the various text panels / graphs / etc which are useful to you and tell you information about your design as you are varying the input parameters. This could be outside of GH possibly and maybe linked to one side of the Rhino viewport.
Any thoughts? Of course some of these requests are asking Grasshopper to expand a bit more into the 'data display/interpretation' space - however I think this is extremely important as with each design I create there is most always associated data which tells me about its performance in some way or another and viewing that / illustrating it to clients in a quick and friendly way is key. Of course what is there already is most impressive and useful!
Cheers
Luke…
(tree info, relationships to certain other objects, etc.) after it's been baked, so that our team can hand tool some of the results, delete certain objects, etc. I'm using the doc.objects.find(guid) function right now - which works fine when I feed a string into the VB component and set the input as a GUID, but am having a hard time casting my strings from Excel into the GUID directly in the VB component. Hopefully it's easy to do and I can whack my palm on my face, as often I do. Here's my script...I get the "specified cast is not valid" error at: Dim obj As Guid = xlSheet.Range(strGUIDColumn & I).Value.
If activate = True Then
Dim xlApp, xlSheet As Object
xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")Dim strSheet As String = "MEM_6"
Dim strGUIDColumn As String = "C"
Dim strDeleteColumn As String = "F"
Dim intCheck As Int16 = xlApp.Worksheets("META").Range("B4").Value
Dim I As Int16
xlSheet = xlApp.Worksheets(strSheet)
For I = 2 To intCheck + 1
Dim obj As Guid = xlSheet.Range(strGUIDColumn & I).Value <- returns my casting error
If doc.Objects.Find(obj) Is Nothing Then
xlSheet.Range(strDeleteColumn & I).Value = "X"
End If
Next
End If
thanks!…
Added by David Stasiuk at 8:05am on December 15, 2010
hold before displaying this in Rhino.
Unfortunately, it only works for one reference plane / room at a time. I've tried a bunch of things but am getting nowhere fast. When I select 3no. floorplates for the Test Surface brep, GH reports that the reColourMesh stage fails and is reporting the following: '1. length of the results [=288] is not equal to the number of mesh faces [=864]''. However, I can see that the .pts and .res files both have 864 values each. (288 values is the number for a single room)
I would appreciate help on adapting it to do the following:
Allow for multiple reference planes / grids in the same model - ie I would like to be able to study any number of rooms in the same model at the same time.
Label each of the rooms / breps individually - ie room 1, room 2, room 3 etc.
Calculate the view of sky for each room / reference plane and cull each to the same threshold before displaying.
Create a list, which I can export / copy to Excel with Room name, total floor area, area above threshold value, ratio of floor area above threshold value.
I would really appreciate any help from you all.
Many thanks
Nick…
need to do a bit of catching up.
In regards to my previous question, your explanation of the functionality in the Tutte algorithm have provided answers as to why the component was failing in my workflow. Within the excel spreadsheet, i have tried to implement an approach where users can define the room connections via a series of abbreviations or code - which then translates to the generation of curve connections native within gH. Some of these connections have less than 3 vertices i.e relationship between bedroom and ensuite. Anyways, it has all been laid out in the sample script that I have attached. I have also tried to implement the matrix system to add weight to the connections based on the rating system in your latest presentation - SpaceSyntax4. I'll continue to explore and touch base with you if I get anywhere. Cheers. …
a surface, only to find that the lines occur twice or more, i understand why they do it, I just dont know how to solve the issue.maybe there is a better way of doing the definition? so i have tried to do variations.I want to extract the lines and the points to excel, only there can not be more than 1 line occuring between the same two points. been trying to do this sorting and deletion for days now without luck.thanks in advance-RasmusNB: Enclosed is my definition, I'm also working on numbering the elements but would like to try doing that myself.…
my post to Lyndon whose understandably engaged.I'm gradually finding own answers, but If your not likewise preoccupied perhaps you've moments for a couple questions if familiar with process,.4) how to alter Lyndon's killer def. so it interpolates between Excel surface coordinates with different xyz points amounts and therefore "cell" amounts?,..i assume both culling and data matching are required, but when time please mention any known requirements\procedures?Lastly,5) as seen in 3 screenshots, when using Untrim, sDivide then Patch Surface(as target)&Trimmed surface(as Source) within Copy Trim, the results are Rotated 90 degrees counter-clockwise around Z. Might you know how to correct this?If i knew Rhino\GH so! powerful and fun, would've used them years ago.Thanks D,J…