989e-044e8580d9cf"; //this is the grasshopper GUIDplugin = rhino.GetPlugInObject(pluginId, pluginId); // rhino is a COM object representing a rhino5 instanceplugin.OpenDocument("D:\MANUEL\Desktop\debugging.gh");
when running the OpenDocument method a window pops up with the following message
Grasshopper breakpointInvalid parsing operation inn GH_DigitNumber.Value
Running equivalent code in the RhinoPythonEditor works well.Please note that "plugin" in the code is an instance of "GH_RhinoScriptInterface" from the graashopper API.
Thanks.Manuel…
lections import defaultdict
example_list = [[1,2,4], [1,2,3], [3,4,3], [1,2,3], [5,7,1], [3,4,3], [5,7,1], [1,2,4], [9,4,9], [9,3,9], [9,4,9]]
d = defaultdict(list)
for item in example_list: d[tuple(item)].append(item)
groupedlist = sorted(d[x] for x in d)
print groupedlist
# Returns [[[1, 2, 3], [1, 2, 3]], [[1, 2, 4], [1, 2, 4]], [[3, 4, 3], [3, 4, 3]], [[5, 7, 1], [5, 7, 1]], [[9, 3, 9]], [[9, 4, 9], [9, 4, 9]]]
____________________________________________________
However working with python inside GH the code fails as (I'm assuming the id is included in the list ie.
[<Rhino.Geometry.Point3d object at 0x0000000000000BD0 [1611664.12669822,2952929.94466619,5788.70761766478]>]
If I print my object[0] i get just the vector, i.e [1611664.12669822,2952929.94466619,5788.70761766478]
However if i append my object, (for i in xrange (len(X)... list.append(my object[x])
The id included!?
[<Rhino.Geometry.Point3d object at 0x0000000000000BD0 [1611664.12669822,2952929.94466619,5788.70761766478]>]
Perhaps I'm over complicating this and should just use GH to group objects with the same position...
Also sometimes when getting vectors I receive long numbers such as.. 9.0122222900391e(10), and another times I don't.... Same file, script, geometry etc..
I'm quite a noobie in python for GH so any help or pointers are welcome...
Thank you in advance!
…
0));
RhinoDoc.ActiveDoc.Objects.AddLinearDimension(d);
Vb.Net
Dim d as New LinearDimension(Plane.WorldXY, New Point2d(10, 10), New Point2d(-10, 10), New Point2d(-5, 0))
RhinoDoc.ActiveDoc.Objects.AddLinearDimension(d)
- Giulio
______________
giulio@mcneel.com
McNeel Europe, Barcelona…
ruct Brep (V) --> Create Set
(L) Create Set: Flatten = True
Deconstruct Brep (V) --> (D) Find Similar Member
Create Set (L) --> (S) Find Similar Member
Deconstruct Brep (V) --> (P) Point to Numbers
(P) Point to Numbers: Graft = True
Find Similar Member (i) --> (D1) Merge
Find Similar Member (i): Simplify = True
# The (i) output is the N in the macro
(D1) Merge: Graft = True
Point to Numbers (N) --> (D2) Merge
Point to Numbers (N): Simpify =True
# The (N) outputs are the x,y,z components of the macro
Create Panel[1], Panel[2], Panel[3]
Panel[1] = ,
Panel[2] = E,
Panel[3] = N,
# start to combine all the parts together
Panel[1] --> (J) Text Join[1]
Find Similar Member (i) --> (T) Text Join[1]
Merge --> (T) Text Join[2]
Panel[1] --> (J) Text Join[2]
Panel[2] --> (A) Concatenate[1]
Text Join[1] --> (B) Concatenate[1]
Panel[3] --> (A) Concatenate[2]
Text Join[2] --> (B) Concatenate[2]
Concatenate[2] --> (D) Shift Paths
Shift Paths --> Tree Statistics
Tree Statistics (C) --> (C) Series
Series --> Int
Create Panel[4], Panel[5]
Panel[4] = "! Panel #"
Panel[5] = 0
Panel[5] = 1
# make sure Panel[5] is set to not multi-line
Panel[4] --> (A) Concatenate[3]
Int --> (B) Concatenate[3]
(B) Concatenate[3]: Graft = True
Concatenate[3] (R): Simplify = True
Shift Paths --> (L) List Insert
# make sure the next hooks are in order
Concatenate[2] --> (I) List Insert
Concatenate[3] --> (I) List Insert
Panel[5] --> (i) List Insert
List Insert (L): Flatten =True
List Insert --> Panel[6]
Panel[6]: Stream Contents =True…