oCommonSDK, I modified a working C# component that does something similar (ReduceMesh, written by Andrew Heumann). Both scripts are attached.
Aside from changing the component name and eliminating the P parameter, I made two modifications to the script:1) changed line 87 from private void RunScript(Mesh M, double P, ref object A) to: private void RunScript(Mesh M, ref object A)2) changed line 93 from: Rhino.RhinoApp.RunScript("_-ReduceMesh _ReductionPercentage " + Convert.ToString(P) + " _Enter", false); to: Rhino.RhinoApp.RunScript("_-MatchMeshEdge " + " _Enter", false);When I run the ReduceMesh component, the mesh object I feed it gets baked, the ReduceMesh command is run, the temporary object is deleted, and the reduced mesh result is returned. (Thanks, Andrew).When I run the MatchMeshEdge component, the mesh object I feed it is baked, the MatchMeshEdge command is run, but the temporary object is not deleted and no result is returned. The runtime error reads: "Sequence contains no elements (line 0)". I have a feeling that the command line string I am handing to RunScript is incomplete. When I enter it manually on the Rhino command line I see that it wants a mesh and three parameters. Of course I can hit Enter to accept the default values, but when you invoke a command through RunScript do you have to supply all parameters regardless? Also, where would I find details on the argument types that the command wants? For example, the last parameter reads "RatchetMode=On" or "RatchetMode=Off". How do I know if the type is Bool or the literal string "On" or "Off"?I am a complete novice at this so any help you can provide would be greatly appreciated! …
greatly appreciate it!!
You can write the number of the question and write your answer next to it, example:
1) a
2) c
3) a) Washington University in St. Louis
4) 2 weeks (1week+1week shipping)
5) 130
6) b
7) b
The survey questions are as follows:
1)
Did you 3D print before?
5)
How much did it cost (in dollars)?
a.
Yes, for a school project
a.
Between 20 & 50
b.
Yes, for a personal project
b.
Between 50 & 80
c.
Between 80 & 120
2)
Print size
d.
Please specify if otherwise: _____ dollars
a.
Between 2 & 6 cubic inches
b.
Between 6 & 12 cubic inches
6)
Do you think the price was expensive?
c.
Between 12 & 20 cubic inches
a.
Not at all
d.
Please specify if otherwise: ____cubic inches
b.
A little bit expensive
c.
Very expensive
3)
Where did you print your object?
a.
School
7)
Were you satisfied with the printed object?
b.
Outside school: _________________
a.
Yes, it was a great print without problems
b.
Not bad, some issues
4)
How long did it take to print?
c.
I was not satisfied, very bad quality
a.
___ days
b.
___ weeks
Thank you very much to all!!
PS: If you did many 3D prints, you can post multiple answers.
Wassef…
rection: there's no visible demand. Explanation: a lot of AEC oriented people (Smart Geo daydreamers) they think - potentially - about GH but they are rejecting it for more than obvious reasons: our job is 1% about the smart thing and 99% about the structured aspect of the smart (or stupid thing).
Back to that "hangar" : The primary role of this GH definition provided herein (and hopefully some future updates) is NOT to outline some academic solution (via some abstract collection of pipes/lines/points/surfaces) ...but to place in 3d space - properly structured - all the real-life (hmm, he he) bits that can compose the actual project. Of course if the bits could be parametrically driven assemblies ...well...you get the gist of the message.
All in all: I think that Engineers who are GH skeptics could see GH with a totally new perspective if, say, a collection of similar examples/test cases could be available for demo/evaluation/whatever > Ah! at last : this appears to be a real thing > what software did it? > say it again - Grass Components you said? > what sort of name is this? ... etc etc etc.
But since a similar development is quite expensive (and requires a team of several gurus), maybe this is rather a future potential task for the GH/Rhino people if they think that the AEC market segment could be beneficial for their products. Combine a similar capability with tools like yours and/or Evolute (planar quads are "a-la-mode" these days).
PS: forget trivial stuff > what about Stefanie? (plan B : better something than nothing)…
e case pictured already: don't bother how this truss is made and never mind that the def attached looks like an "add-on" (no components) - because it could be (so don't get stuck on that, it's irrelevant). In fact since the critical part (the 99% of the whole) if only doable with code ... it makes sense to do the rest with code as well (but that's my personal preference anyway, he he). Note: Balls are excluded from the demo.
You can toggle what "class" of struts is gonna being made with these booleans:
You can vary the sliders and if the code thinks that you make a valid input ... it obeys, he he.
But the big questions are:
1. Can you work with this in some interactive way? I mean vary any slider and ... wait ... for some change. Although the MERO components here are created ONCE and then placed around (minus obviously the tubes) ... they are placed as copies of the "donor" object (not instance definitions) creating a vast "pool" of "unnecessary" data.
2. What happens if you bake these little thingies? What file size you get? Is it OK?
But the bad news are that as I said ... this is ... NOT a task for a novice ... nor you can handle this get-a-truss-and-make-a-MERO-thing goal with half-measures: either you should do it properly ... or abandon ship.
NOTE: Load R file first (nothing is internalized).
Moral: even if this was made with components ... it wouldn't serve much.
best, Peter…
H are automated by using them as an ActiveX, the C# script object fails on the simplest tasks. That is, when initiating Rhino and GH externally (as by the following C# code):
Rhino5Application rhino_app = new Rhino5Application();
dynamic grasshopper = newRhino.rhino_app.GetPlugInObject("b45a29b1-4343-4035-989e-044e8580d9cf", "00000000-0000-0000-0000-000000000000") as dynamic;
The following very simple C# script component fails because it cant cast its input:
The c# code at the component is only:
Line 89 is simply casting of the input. Clearly, this makes the usage of C# component, under automation, impossible which is a major loss.
As said, when initiating Rhino and GH manually , all works well as in the following:
Any ideas why it misbehaves under automation (as an Active X ) ?
I added the gh file of this example.…
whole design intent, but this is what Inventor is good at. The way it packages bits of 'scripted' components into 'little models' that can be stored and re-assembled is central to MCAD working.
The Inventor model shown is almost 5 years old. We don't model like that any more, however it does offer a good idea of general MCAD modeling approaches.
iParts is useful in certain situations, it could've been useful in the above model, its usefulness is often in function of the quantity of variants/configurations.
So much is scripted in GH, maybe it should also be possible to script/define/constrain/assist the placement/gluing of the results?
...
Starting point: I think we are talking across purposes. AFAIK, the solving sequence of GH's scripted components is fixed. It won't do circular dependencies... without a fight. The inter-component dependencies not 'managed' like constraints solvers do for MCAD apps.
Components and assemblies are individual files in MCAD.
Placement of these within assemblies in MCAD is a product of matrix transforms and persistent constraints. There is no bi-directional link, the link is unidirectional (downflow only), because of the use of proxies.
Consequently, scripting the placement of components is irrelevant in GH, unless you decide that each component needs to be contained in its own separate file.
This also brings up the point that generating components and assemblies in MCAD is not as straightforward. In iParts and iAssemblies, each configuration needs to be generated as a "child" (the individual file needs to be created for each child) before those children can be used elsewhere.
You notice the dilemma, if you generate 100 parts, and then you realize you only need 20, you've created 80 extra parts which you have no need for, thus generating wasteful data that may cause file management issues later on.
GH remains in a transient world, and when you decide to bake geometry (if you need to at all), you can do that in one Rhino file, and save it as the state of the design at that given moment. Very convenient for design, though unacceptable for most non-digital manufacturing methods, which greatly limits Rhino's use for manufacturing unless you combine it with an MCAD app.
One of the reasons why the distributed file approach makes perfect sense in MCAD, is that in industry you deal with a finite set of objects. Generative tools are usually not a requirement. Most mechanical engineers, product engineers and machinists would never have any use for that.
The other thing that MCAD apps like Inventor have, is the 'structured' interface that offers up all that setting out information like the coordinate systems, work planes, parameters etc in a concise fashion in the 'history tree'. This will translate into user speed. GH's canvas is a bit more freeform. I suppose the info is all there and linked, so a bit of re-jigging is easy. Also, see how T-Flex can even embed sliders and other parameter input boxes into the model itself. Pretty handy/fast to understand, which also means more speed.
True. As long as you keep the browser pane/specification tree organized and easy to query.
:)
Would love to understand what you did by sketching.
I'll start by showing what was done years ago in the Inventor model, and then share with you what I did in GH, but in another post.
Let's use one of the beams as an example:
We can isolate this component for clarity.
Notice that I've highlighted the sectional sketch with dimensions, and the point of reference, which is in relation to the CL of the column which the beam bears on. The orientation and location of the beam is already set by underlying geometry.
Here's a perspective view of the same:
The extent of the beam was also driven by reference geometry, 2 planes offset from the beam's XY plane, driven by parameters from another underlying file which serves as a parameter container:
Reference axes and points are present for all other components, here are some of them:
It starts getting cluttered if you see the reference planes as well:
Is I mentioned earlier, over time we've found better ways to define and associate geometry, parameters, manage design change, improving the efficiency of parametric models. But this model is a fair representation of a basic modeling approach, and since an Inventor-GH comparison is like comparing apples and oranges anyways, this model can be used to understand the differences and similarities, for those interested.
I haven't even gotten to your latest post yet, I will eventually.…
Added by Santiago Diaz at 10:36am on February 26, 2011
ard to find example...
I do not know how to load windows form and send data to object in form.vb...using grasshopper sdk.
it is the same,, when I try to use dll(class) with VB component in grasshopper.
may be I have to make two class (class1, form1) but,
when I send data to class1, form1 can not receive class1 data because form 1 made new class1 and both class1, class1(from form1) is different session?
for novice programer,, for me it is very hard.
load class1,
class1 load form1
send data from grasshopper to form1. x
and button click
couldn't calculated,... result was always "0"
and tried many other methods,, but it failed...
may be some known technic but it is hard to find books...
Please...help me.
if possible would you tell me how to load form1 using grasshopper sdk and ""send data "" to form1
or form1 could use data from grasshopper?
Thank you....
for ex)
'(in class.vb)
Public Class Class1 Private Shared fl As Form1 Public Sub fload() If fl Is Nothing Then fl = New Form1 fl.Show() End If End SubEnd Class
'(in form1.vb)
Public Class Form1 Public x, y As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ab(x, y) MsgBox("hi" & y) End Sub Sub ab(ByRef a As Double, ByRef b As Double) b = a * 2 End SubEnd Class
'(in Grasshopper VB.component)
Dim cl As ClassLibrary1.Class1 If cl Is Nothing And f = True Then cl = New Class1 cl.fload() End If Dim fr As ClassLibrary1.Form1 If fr Is Nothing Then fr = New Form1 End If fr.x = x a = fr.y…
f my list.I don't understand why, but I guess I must be too young user ^^In the original list, i have a path {0;0;0;4} with two index and after the random node, {0;0;0;4} has 88 index.Items are not correct?I would have a comparable structure has the right list on my jpg (photomontage...)How I can do that?Thank you in advance
…
er, i hae drawn a quck sketch. Different curves in blue and orange colour. i have marked on my sketch which is a a non-planar surface.
At the moment, i have modeled this with NURBS curve component (component without Knots & Weights). I have set 5 to its 'P' intput (I'm going to reduce it to 3). Each point having 3 parameters X, Y & X axis. I have set my slider from -100mm to 100mm range. It is a closed curve.
If i just loft it, i get random results which i donot want. I can get a planar surface if i set Z parameter to zero. But how do i get a non planar and preferably a burbs surface?
the curves are very important to this projects. as Whole form is dependent on these curves.
Your tips will be highly appreciated. If you have different way of modelling it, I'm open to suggestion too.
cheers,
aB…