d of interpenetrating surfaces somewhere:
Now all links (except a possible single ball on the very end of odd numbered ball series) are four balls long, including the jostled ones. Without that step, those items simply don't appear in the output, leaving way too big of gaps to ignore, eventually leaving huge gaps at later stages of segment doubling:
So if I turn the jostling multiplication factor way down it should work imperceptibly:
Ta-dah! The jostling strategy WORKS! Granted, only in this special case where I know I'm dealing with adjacent pairs of worms along a curve, not generic objects arranged in space by some artist.
Now I just need to wrap the multiple Python script components I'm stringing together into one script.
How long does the full 2400 balls take, finally? It took 12 Python scripts that merge pairs, to achieve this breakdown: 2400 -> 1200 -> 600 -> 300 -> 150 -> 75 -> 38 -> 19 -> 9 -> 5 -> 3 -> 2 -> 1. Time was 2 minutes 50 seconds, so there is some extra struggle for 2X as many balls as 1200 that took 1 minute 20 seconds, but only ten more seconds.
…
Added by Nik Willmore at 9:06pm on February 17, 2016
mers considering extreme sports reject mainstream retailers and like to check out small stores rather of at chains plus malls. Several smaller retailers discuss trends in sports shoe sales. http://skateszone.com/
Though athletic shoes and sports stores and from doorways retailers have reported somewhat uptick in footwear sales due to the increase in extreme sports, the particular beneficiaries inside the trend are independent surf and skate niche stores.
Some West Coast surf and skate shops stated teenagers and even more youthful Generation Xers are not only rejecting traditional sports, but they're also shunning mainstream retailers and malls meant for smaller niche shops transporting hard-to-come-by brands.
Eddie Miyoshi, district manager at Atomic Garage, a 3-store chain situated in Gardena, Calif., stated the soaring recognition of skateboard footwear has boosted the retailer's total footwear business 20-thirty percent this year, rather of '95.
Skate footwear presently represent 80-90 % of Atomic Garage's shoe sales, while couple of years back, Dr. Martens and Timberland drove the retailer's footwear business.
Like many retailers, Miyoshi pointed to Airwalk since the trend's catalyst.
However, if Airwalk broadened its distribution to larger chains, which are frequently located in malls, only a few skate shoe customers adopted. Rather, many youthful males have switched for your skate shops for additional elusive brands like Etnies, Duffs, and Electricity Footwear by Circus. By refusing to market bigger retailers or sports stores, these brands are increasing their cachet among youthful consumers.
"Kids don't want stuff which have been within the shops,In . Miyoshi added.
Searching ahead, Miyoshi forecasted skate shoe sales will remain strong through spring '97 provided "the [hot] vendors don't auction other [non-particularly shop] retailers."
"Skaters and non-skaters are rebelling against mainstream retailers so on to surf and skate shops for many looks," echoed Mark Richards, co-online sources Val Surf, a 3-store chain situated in North Hollywood, Calif. Soaring sales of skate footwear have driven total footwear receipts up 25 percent this year rather of '95.
"The quantity of that increase might be connected while using exposure of maximum games? I am unsure. [Skate footwear] may also be actually the think about the moment,In . Richards acknowledged. And in relation to getting this right look, youthful customers can be very picky.
"Skateboard footwear is a huge category for people, but we're not able to own the brands, Etnies, Duffs, Electricity and Nice, simply because they won't sell us," stated Mark Anderson, buyer at Chick's Sports, a six-store chain in Covina, Calif. "We have people coming every single day requesting them." Consequently, skate footwear have consistently ongoing to obtain about 5 % of Chick's overall footwear business. http://skateszone.com/the-top-8-best-skateboards-for-beginners-reviews-2017/
Nonetheless, some outdoors, niche sports and sports retailers are noting the growing recognition and coverage of maximum sports will receive a modest impact on footwear sales. Trailrunning footwear and approach/outdoors crosstrainers will be the two groups benefiting the very best inside the recognition. Like the skate shoe business, some retailers realize that styling instead of function frequently drives sales of individuals footwear.
"At this time the merchandise is a lot more visual than function," stated Chet James, gm of Super Jock 'N Jill, Dallas, speaking about trailrunning footwear. Still, James noted the current hype over adventure sports helps draw more customer traffic. "The marketing campaigns and media help bring growing figures of people in, nonetheless they frequently occasions day an issue that increases results on their own account,Inch he conceded.
John Wilkinson, executive vp inside the 85-store chain Track 'N Trail, Eldorado Hillsides, Calif., stated the shop has "seen some activity in approach footwear," but he requested the amount of consumers depend in it commercially sport. And, instead of accelerating total footwear business, Wilkinson speculated elevated sales of approach footwear and trailrunners are gnawing away at traditional hiking shoe and boot volume.
But Dan Bazinet, president of Overland Exchanging, a 34-store chain situated in Westford, Mass., believes the company-new looks have breathed existence for the wilting hiking boot category. "[Approach-type footwear] don't represent the lion's participate the hiking market, nonetheless they have elevated the hiking business and provided us extra sales," Bazinet stated.
He designated Timberland's Treeline Series and Rockport's Leadville line as strong performers. Unsurprisingly, he noted the company-new looks are attractive to youthful consumer base than traditional hikers.
For that month of June, sales of men's hikers were up 49 percent at Overland, rather of June '95, while sales of women's hikers were up 17 % for that month. Bazinet also attributed elevated sales that shops walked inside the hiking business, departing that business for that specialists.
Some retailers draw a good example concerning the hiking boom of two yrs ago combined with the current extreme sport phenomenon. "Plenty of bigger chains will get a specific percent in the industry while [extreme] sports remain a fad because they are selling cost-point type gear," described Steven Carre, assistant hard goods buyer at Adventure 16, a six-store chain situated in Hillcrest.
"However individuals [true enthusiasts] will say `we need real gear' and may shown up at us. That will help us after a while. What Size Skateboard good for an 3 4 5 6 7 8 9 10 11 12 13 14 year old
…
- nickname is rather the best approach - and not on active group, but that's irrelevant anyway).
Step back (assuming that you are talking about the "Tens_from_random_blah_blah" definition):
1. Engineering is the art of demystifying (or we are promising that anyway, he he). This means that you start defining (better: outlining) some topology for things based on some "generic" rules (like the ones applied for the masts,cables,cones etc etc). These things are kept in some kind of structure (Lists, DataTrees etc). Things are few in 99.99999% of cases (i.e. : even the biggest membrane "module" has, say, 20-50 masts per "module").
2. Then ... handling things "individually" (mostly modifying) becomes the most critical part. See this (an x "possible" solution by combining a myriad of "options" : a no cones membrane solution, in plain English):
3. But the above is impossible (for more than obvious reasons). You should deploy masts in some high/low sequence in order to achieve some meaningful convex/concave formation that could work.
4. This "works" : 5. This doesn't:
6. This works partially (the formation at the back is "flat" == undo able):
7. This is utterly kitsch (and faulty as the case6 - the back portion):
So it's quite obvious that without a (quite complex) capability to individually control things (in this occasion : mast heights) the whole definition is a waste of computer time. Additionally the more the solution is "demystified" (some curve is defined, some random points are created, some masts are in place, some cables appear etc etc) the more additional constrains are required in order to "narrow" the possibilities (In plain English : sliders should control other sliders as regards their min/max values, true/false, you/me etc etc).
Remember that we are talking about ONE (mast height) out of a myriad things that you should control "manually" (it's utterly pointless to mastermind some kind of "generic" rules - or use naive attractors etc etc) .You'll see the difference when I'll completely reform the definition by adding individual control upon anything.
PS: what about the blocks? (the real life stuff that actually make any solution possible). Can you imagine a 2nd set of "restrictions" imposed by "a child to his parent"? (Assembly/Component modeling , that is).
more soon
…
uick answers. Below you will find some suggestions, but don't think of them as rules and especially don't think of them as guarantees.
1. Choose a descriptive title for your post
Don't call your question "Help!" or "I have a problem" or "Deadline tonight!", but actually describe the problem you are having.
2. Be succinct but clear in your wording
People need to know some details about your problem in order to understand what sort of answers would satisfy you, but nobody cares about how angry your boss or how bad your teacher or how tight your deadline is. Talk about the problem and only the problem. If you don't speak English well, you should probably post in your native language as well as providing a Google Translation of your question.
3. Attach minimal versions of all the relevant files
If you have a GH/GHX file you have a question about, attach it to the post. Don't expect that people will recreate a file based on a screen-shot because that's a lot of pointless work. It's also a good idea to remove everything non-essential from a GH file. You can use the 'Internalise Data' menu option to cut everything to the left of a parameter:
If you're importing curves or Breps or meshes from Rhino, you can also internalise them so you won't have to post a 3DM file as well as a GH file. If you do attach large files, consider zipping them first. Do not use RAR, Ning doesn't handle it.
It is especially a good idea to post files that don't require any non-standard components if at all possible. Not everyone has Kangaroo or Hoopsnake or Geco installed so if your file relies on those components, it might not open correctly elsewhere.
4. Include a detailed image of the GH file if it makes sense
If your question is about a specific (group of) components, consider adding a screenshot of the file in the text of the post. You can use the Ctrl+Shift+Q feature in Grasshopper to quickly create nice screenshots with focus rectangles such as this:
5. Include links to online resources if possible
If you have a question about Schwarz Minimal surfaces, please link to a website which talks about these.
6. Create new topics rather than continuing old ones
It's usually better to start a fresh question, even if there's already a discussion that kinda sorta tangentially touches upon the same issue. Please link to that discussion, but start anew.
7. This is not a 'do my work for me' group
Many of us like to help, but it's good to see effort on our part being matched by effort on your part. Questions in the form of 'I need to do X but cannot be bothered to try and learn the software' will (and should) go unanswered.
7b. Similarly, questions in the form of 'How do I quickly recreate this facade that took a team of skilled professionals four months to figure out?' have a very low success rate.
--
David Rutten
Lead Grasshopper Development
Robert McNeel & Associates…
Added by David Rutten at 12:58pm on October 1, 2013
rring to the above image)
Area
effective
effective
Second
Elastic
Elastic
Plastic
Radius
Second
Elastic
Plastic
Radius
of
Vy shear
Vz shear
Moment
Modulus
Modulus
Modulus
of
Moment
Modulus
Modulus
of
Section
Area
Area
of Area
upper
lower
Gyration
of Area
Gyration
(strong axis)
(strong axis)
(strong axis)
(strong axis)
(strong axis)
(weak axis)
(weak axis)
(weak axis)
(weak axis)
A
Ay
Az
Iy
Wy
Wy
Wply
i_y
Iz
Wz
Wplz
i_z
cm2
cm2
cm2
cm4
cm3
cm3
cm3
cm
cm4
cm3
cm3
cm
I have a very similar table which I could import to the Karamba table. But I have i_v or i_u values as well as radius of inertia for instance.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dimensjon
Masse
Areal
akse
Ix
Wpx
ix
akse
Iy
Wpy
iy
akse
Iv
Wpv
iv
Width
Thickness
Radius R
[kg/m]
[mm2]
[mm4]
[mm3]
[mm]
[mm4]
[mm3]
[mm]
[mm4]
[mm3]
[mm]
[mm]
[mm]
[mm]
L 20x3
0.89
113
x-x
4,000
290
5.9
y-y
4,000
290
5.9
v-v
1,700
200
3.9
20
3
4
L 20x4
1.15
146
x-x
5,000
360
5.8
y-y
5,000
360
5.8
v-v
2,200
240
3.8
20
4
4
L 25x3
1.12
143
x-x
8,200
460
7.6
y-y
8,200
460
7.6
v-v
3,400
330
4.9
25
3
4
L 25x4
1.46
186
x-x
10,300
590
7.4
y-y
10,300
590
7.4
v-v
4,300
400
4.8
25
4
4
L 30x3
1.37
175
x-x
14,600
680
9.1
y-y
14,600
680
9.1
v-v
6,100
510
5.9
30
3
5
L 30x4
1.79
228
x-x
18,400
870
9.0
y-y
18,400
870
9.0
v-v
7,700
620
5.8
30
4
5
L 36x3
1.66
211
x-x
25,800
990
11.1
y-y
25,800
990
11.1
v-v
10,700
760
7.1
36
3
5
L 36x4
2.16
276
x-x
32,900
1,280
10.9
y-y
32,900
1,280
10.9
v-v
13,700
930
7.0
36
4
5
L 36x5
2.65
338
x-x
39,500
1,560
10.8
y-y
39,500
1,560
10.8
v-v
16,500
1,090
7.0
36
5
5
I have diagonals (bracings) which can buckle in these "non-regular" directions too, and they do. If I could add those values then in the Karamba model I could assign specific buckling scenarios..... I can see another challenge which will be at the ModifyElement component, I will not be able to choose these buckling lengths, in these directions.
Do you think this functionality can be added within short, or should I try to find another way to model these members?
Br, Balazs
…
len , I lost all of my work (at least the 3d modeling)
And I frankly if I want to participate I´ll need to finnish up the board and i cant do the renders on my own I need more time , but I only have until 11:59 pm of July 6 to finnish up one render, if you feel up to the challenge, whoever completes it will receive 290 dollars (its all I can give) to any account you want. I basically need one single image.
It consists on 3 towers, with an organic facade, I'm including the competition board I had saved on in my dropbox, I want more or less the same perspective shown on the left of the board.
Sorry, but i'm desperate, I had it all done but well cant control everything in life i guess, only do it if you feel you can pull off a professional render.
Thanks. (contact me and I´ll give you more info on the towers, I was able to save some limited sections and floor plans .... but yeah.. limited, so you´ll have to base your work on the images I provide here.
I can give some files now, including images of the physical model.
Board: http://i.minus.com/idYpFK844DWns.jpg
Physical model: http://imgur.com/a/PywJa
Hope its enough, I'm also including one image i had where I explored the footprints of all the buildings, but its just for reference.
I know theres barely enough time to finnish it... but I dont know what else to do, do you guys think i should probably just take a good photograph of the model and run with that? I feel that would probably look very unprofessional :l but I really dont have a choice here
…
ity...? How to define this parameters and simulate them? How to simulate and evaluate form? How to work with Evolutionary Solver inside Grasshopper3d? How to evaluate end data and choose the fittest geometry? How to optimize geometry to increase overall energy efficiency of project!?
»»» Rhinoceros 5 + Grasshopper 3D & Sub-Plugins *required grasshopper plugins: Elk, LadyBug + Honeybee, Mesh edit (uto tools), Mesh+, Weaverbird, Human, TT Toolbox, Lunchbox, Horster tools, Exoskeleton & Cytoskeleton
>>>Please download and install Rhino + GH3D & Sub-Plugins before workshop start!<<<
with Igor Mitrić
DIGITAL FABRICATION BASICS - 3D SCANNING AND 3D PRINTING
Workshop would provide overview of current state of technologies for 3D scanning and 3D printing with those affordable and practical devices for research and development new design projects. Attendees would use 3D scanner to generate 3D model in virtual computer space, remodel, and prepare for 3D printer.
with Roberto Vdović
OPTIONAL FIELD TRIP - ON SITE ENERGY MEASUREMENTS (19.6.2015)
with Benedikt Borišič and Veronika Madritsch
Participants will receive CERTIFICATES of knowledge acquired at the workshop for each section. Participation is FREE! The number of places is LIMITED!
MORE INFORMATION AND APPLICATION WWW.LIVECONST.EU
WORKING SCRITPS
Day 1 City.gh
Day 2 Lady Bug.gh
Day 3 Galapagos
Record Galapagos.gh
Day 3_First Half.gh
Day 3 Second Half.gh
Tower from any Curve.gh
…
hat, in accordance with this stable release, I have posted an updated version of this outdoor microclimate map example to the same link:
http://hydrashare.github.io/hydra/viewer?owner=chriswmackey&fork=hydra_2&id=Outdoor_Microclimate_Map
1. You will see that, in the new file, I now have a single component that is able to turn a zone into a "ground zone" (similar to a plenum). To clarify, both the plenum and ground zone components set all of the loads of the zone to 0 (no internal heat gain). So this means that any of the characteristics of the default office program will be negated. From your comments, Grasshope, it seems that you understand that the reason why I have a ground zone defined in this model is to account for the variation in ground surface temperatures that can occur with different objects casting shade onto the ground. Therefore, the key property that defines this zone is the construction of the top surfaces, which is now changed based on a number that you input into the Ground Zone component.
2. You are correct in understanding the need for both "set zone construction" components in the old file. Because of the zone's position below the Rhino model origin, the walls and floor are defined as underground surfaces and so I need the extra "Set EP Ground Construction" component. Admittedly, the constructions on the underground surfaces should have a minimal effect on the modeling of the surface temperature above the zone (the roof construction is most important) but it made sense to me that results would be more accurate by setting all of the constructions of the zone to the ground material. The current Ground Zone component ensures that all surfaces of the zone are assigned the ground material construction. It also ensures that all walls and floor surfaces have a ground boundary condition regardless of where they sit in relation to the rhino model origin.
3. The distFromFlrOrSrf input can take either a number representing the distance from the floor of zones at which you would like to build a microclimate map or any surface on which you would like to see temperature variation. So the input is flexible and allow you to both build micro-climate maps quickly or take a longer time building them with more customization. For a visual of what you can do by inputting surfaces into this component, see this thermal animation of a section through a building that I designed for my thesis:
https://www.youtube.com/watch?v=WJz1Eojph8E&list=PLruLh1AdY-Sj3ehUTSfKa1IHPSiuJU52A&index=3
For an example of a file using a numerical input for the microclimate map, see here:
http://hydrashare.github.io/hydra/viewer?owner=chriswmackey&fork=hydra_2&id=Indoor_Microclimate_Map
4. The component has since been renamed (sometime in early July) to be called "Honeybee_Microclimate Map Analysis". Originally, I developed the component to help me understand thermal diversity within zones but realized after building it out that the same method could be used to give deeper understandings of the outdoor environment. So, at present, it can do both indoor and outdoor microclimate maps. The only shortcoming at present is that the outdoor microclimate map uses EnergyPlus's oversimplified means of accounting for outdoor wind (a simple wind profile that does nto account for obstructions). This shortcoming will be addressed once the first stable release of butterfly is out or I manage to work in components into LB that use the botlzman lattice particle collision method to approximate outdoor wind speeds. Other than this shortcoming, you can trust that all results you are getting from these components are to a high degree of accuracy (meaning that all air temperature and MRT values are accurate).
5. Thanks for pointing this out. This is a mistake in my labeling of the file names and I will fix this before the end of today. When you use the workflow with the PMV recipe, these values are actual PMV/PPD values. When you use the Adaptive comfort recipe, these values are "degrees from neutral temperature" and "Comfortable Or Not" values. When you use the workflow with the UTCI recipe, these values are also "degrees from neutral temperature" and "Comfortable Or Not" values but they are different for UTCI than they are for the adaptive model. Specifically, the neutral temperature and comfort zone for UTCI is defined to be the same as it is in this publication:
https://www.ipma.pt/en/enciclopedia/amb.atmosfera/index.bioclima/index.html?page=utci.xml
Hope this helps and let me know if you have any more questions,
-Chris…
de modelación en 3D y aprovechen las ventajas que plantean, como mejorar su proceso de diseño y explorar múltiples alternativas para un proyecto en lapsos de tiempo muy reducidos en comparación de los métodos tradicionales.
En consecuencia, los alumnos tendrán la posibilidad de disminuir sus tiempos de trabajo, con resultados iguales o incluso mejores a los que obtenían con anterioridad; mejorar la calidad de sus presentaciones y, lo que es más importante, ampliar la fundamentación de sus proyectos en el aspecto funcional y formal, dependiendo de las características del proyecto.
Para lograr estos objetivos, se contemplan dos temarios y un ejercicio práctico.
Al finalizar el curso, los asistentes serán capaces de manejar Rhinoceros y Grasshopper en un nivel medio, con el objetivo que el alumno pueda continuar aprendiendo con alguno de nuestros siguientes workshops o de manera autodidacta.
Además del contenido teórico se incluye un ejercicio práctico, la magnitud del ejercicio y el material que se le destine se definirán con base en el número de asistentes.
El workshop tiene una duración de cinco sesiones:
Sesión 1 – Temario de Rhinoceros
Sesión 2 y 3 – Temario de Grasshopper
Sesión 4 y 5 – Ejercicio práctico
El horario es de 9 am a 4 pm, con una hora de receso para tomar un refrigerio.
No es necesario traer el equipo necesario para trabajar, se cuenta con un equipo para cada persona asi como el material de trabajo para el ejercicio práctico, por lo cual se les recomienda que no traigan portátiles u otro material, únicamente dispositivos de almacenamiento si desean guardar sus trabajos.
El costo del evento es de $3,500 estudiantes y $4,000 profesionales.
(Para poder tener el descuento de estudiante es necesaria una constancia de la universidad de la que proviene, acreditando que el interesado está cursando algún semestre de la carrera. Personas graduadas que estén cursando una maestría o algún grado superior no reciben el descuento).
Para apartar su lugar pueden realizar un depósito de $1,500 y terminar de efectuar el pago antes del 15 de abril si es mediante un depósito bancario o el primer día del evento en efectivo.
El evento se realizará en las oficinas de Vegasot, ubicadas en Circuito Cirujanos No. 23-A
Cd. Satélite, Naucalpan, Edo. de México 53100
http://www.vegasoft.com.mx
Para cualquier duda por favor escriban un correo a luzytextura@gmail.com, por teléfono al 044 55 4381 3302, o en facebook.com/archbernardorivera…
.
Things have been working swimmingly in many areas of the plugin, but one particular problem has been tough to solve. I have two components that are trying to read/write to the same memory at the same time, causing Rhino exceptions and crashes.
The conflicts appear to be happening between two components -- one is a "Layer Events Listener" that reports essentially what type of layer event just happened. The other is a "Set Layer Visibility" component that toggles the visibility of a list of layers.
The code:
public class LayerTools_LayerEventsListener : GH_Component { /// <summary> /// Initializes a new instance of the LayerTools_LayerListener class. /// </summary> public LayerTools_LayerEventsListener() : base("Layer Events Listener", "Layer Listener", "Get granular information about the layer events happening in the Rhino document.", "Squirrel", "Layer Tools") { }
/// <summary> /// Registers all the input parameters for this component. /// </summary> protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddBooleanParameter("Active", "A", "Set to true to listen to layer events in the Rhino document.", GH_ParamAccess.item, false); pManager.AddTextParameter("Exclusions", "E", "Provide a list of exclusions to stop reading specific events (Added, Deleted, Moved, Renamed, Locked, Visibility, Color, Active).", GH_ParamAccess.list); pManager[1].Optional = true; }
/// <summary> /// Registers all the output parameters for this component. /// </summary> protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddBooleanParameter("Initialized", "I", "Whether the listener changed from passive to active.", GH_ParamAccess.item); pManager.AddTextParameter("Document Name", "doc", "Name of the Rhino document that is changing.", GH_ParamAccess.item); pManager.AddTextParameter("Layer Path", "path", "Path of the modifed layer.", GH_ParamAccess.item); pManager.AddIntegerParameter("Layer Index", "ID", "Index of the modified layer.", GH_ParamAccess.item); pManager.AddIntegerParameter("Sort Index", "SID", "Sort index of the modified layer.", GH_ParamAccess.item); pManager.AddTextParameter("Event Type", "T", "Type of the modification.", GH_ParamAccess.item); pManager.AddBooleanParameter("Added", "A", "If the layer has been added.", GH_ParamAccess.item); pManager.AddBooleanParameter("Deleted", "D", "If the layer has been deleted.", GH_ParamAccess.item); pManager.AddBooleanParameter("Moved", "M", "If the layer has been moved.", GH_ParamAccess.item); pManager.AddBooleanParameter("Renamed", "R", "If the layer has been renamed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Locked", "L", "If the layer locked setting has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Visibility", "V", "If the layer's visibility has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Color", "C", "If the layer's color has changed.", GH_ParamAccess.item); pManager.AddBooleanParameter("Active", "Act", "If the active layer has changed.", GH_ParamAccess.item); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { bool active = false; List<string> exclusions = new List<string>();
DA.GetData(0, ref active); DA.GetDataList(1, exclusions);
RhinoDoc thisDoc = null;
bool initialize = false;
string dName = null; string activePath = null; int layerIndex = -1; int sortIndex = -1; string eventType = null; bool added = false; bool deleted = false; bool moved = false; bool renamed = false; bool locked = false; bool visibility = false; bool color = false; bool current = false;
if (active) { thisDoc = RhinoDoc.ActiveDoc;
initialize = (!previouslyActive) ? true : false;
RhinoDoc.LayerTableEvent -= RhinoDoc_LayerTableEvent; RhinoDoc.LayerTableEvent += RhinoDoc_LayerTableEvent; previouslyActive = true;
} else {
RhinoDoc.LayerTableEvent -= RhinoDoc_LayerTableEvent; previouslyActive = false; }
if (ev != null) { dName = ev.Document.Name; layerIndex = ev.LayerIndex; eventType = ev.EventType.ToString();
if (!exclusions.Contains("Active")) { if (ev.EventType.ToString() == "Current") { // active layer has just been changed current = true; }
}
if (!exclusions.Contains("Moved")) { if (ev.EventType.ToString() == "Sorted") { // active layer has just been changed moved = true; }
}
if (!exclusions.Contains("Added")) { if (ev.EventType.ToString() == "Added") { // layer has just been added activePath = ev.NewState.FullPath; added = true; }
}
if (!exclusions.Contains("Active")) { if (ev.EventType.ToString() == "Deleted") { // layer has just been added
deleted = true; } }
if (ev.EventType.ToString() == "Modified") { // layer has been modified activePath = ev.NewState.FullPath;
//skip sortindex eventType = ev.EventType.ToString();
if (ev.OldState != null && ev.NewState != null) { if (!exclusions.Contains("Locked")) { if (ev.OldState.IsLocked != ev.NewState.IsLocked) locked = true;
} if (!exclusions.Contains("Visibility")) { if (ev.OldState.IsVisible != ev.NewState.IsVisible) visibility = true; }
if (!exclusions.Contains("Moved")) { if (ev.OldState.ParentLayerId != ev.NewState.ParentLayerId) moved = true; }
//if (ev.OldState.SortIndex != ev.NewState.SortIndex) moved = true; if (!exclusions.Contains("Renamed")) { if (ev.OldState.Name != ev.NewState.Name) renamed = true; }
if (!exclusions.Contains("Color")) { if (ev.OldState.Color != ev.NewState.Color) color = true; } }
} }
DA.SetData(0, initialize); DA.SetData(1, dName); DA.SetData(2, activePath); DA.SetData(3, layerIndex); DA.SetData(4, sortIndex); DA.SetData(5, eventType); DA.SetData(6, added); DA.SetData(7, deleted); DA.SetData(8, moved); DA.SetData(9, renamed); DA.SetData(10, locked); DA.SetData(11, visibility); DA.SetData(12, color); DA.SetData(13, current);
}
static bool previouslyActive = false; Rhino.DocObjects.Tables.LayerTableEventArgs ev = null;
void RhinoDoc_LayerTableEvent(object sender, Rhino.DocObjects.Tables.LayerTableEventArgs e) { ev = e;this.ExpireSolution(true); }
And for the layer visibility component:
public LayerTools_SetActiveLayer() : base("Set Active Layer", "SetActiveLayer", "Set the active layer in the Rhino document.", "Squirrel", "Layer Tools") { }
/// <summary> /// Registers all the input parameters for this component. /// </summary> protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) { pManager.AddBooleanParameter("Active", "A", "Set to true to change the active layer in Rhino.", GH_ParamAccess.item, false); pManager.AddTextParameter("Path", "P", "Full path of the layer to be activated.", GH_ParamAccess.item); }
/// <summary> /// Registers all the output parameters for this component. /// </summary> protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) { pManager.AddIntegerParameter("Layer ID", "ID", "Index of layer that has been activated.", GH_ParamAccess.item); pManager.AddBooleanParameter("Status", "St", "True when the layer has been activated.", GH_ParamAccess.item); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { bool active = false; string path = "";
if (!DA.GetData(0, ref active)) return; if (!DA.GetData(1, ref path)) return;
int layer_index = -1; bool status = false;
if (path != null) {
Rhino.RhinoDoc doc = Rhino.RhinoDoc.ActiveDoc; Rhino.DocObjects.Tables.LayerTable layertable = doc.Layers;
layer_index = layertable.FindByFullPath(path, true);
if (layer_index > 0) { // if exists RhinoDoc.ActiveDoc.Layers.SetCurrentLayerIndex(layer_index, true); status = true; } }
DA.SetData(0, layer_index); DA.SetData(1, status); }
Now originally I was getting exceptions when changing multiple layers' visibility properties, which would cause the Event Listener to fire and try to read the Visibility property before the memory has been released by the Set Layer Visibility component. That led me to add an "Exceptions" input, that would allow me to disable the reading of Visibility events at the source in the Layer Events listener. That helped me manage about 95% of the crashes I was getting, but I still get strange crashes in other event properties, even when that property shouldn't be affected. For instance, I am getting a crash here on the Name property in the event from the delegate function, even though I am only changing Visibility at any one time:
I have a few ideas but they all seem pretty hacky. One is to try to set a flag that is readable by any component in the plugin -- so that the event listener can see if a "set" component is currently running and abort before causing an exception. The other is creating a delay in the event listener, somthing like 200ms, to allow any set components to finish what they are doing before reading the event. Neither seems super ideal.
Any ideas?
Thanks,
Marc
…