Change how a node works


#1

Hi guys,

I was wondering if it’s possible to change how a node works…

For example for the node below
Capture1

 

 

 

 

 

 

 

 

How can i know how it works?
How can I change some parameters?

For example:
Let say that I have a list that contain N parameters A B C D etc…(the length of the list is not a standard… it will change)

I will use this list for both the input of that node

 

 

 

 

 

 

 

 

 

 

 

At the moment the node check if there is an intersection from the List Geometry to the List Entity… the problem is that there will be always an intersection for each element of the List Geometry:

Each element has an intersection with itself (see the pic below).

Capture6

 

 

 

 

 

I would like to use that node just to check if an element of the List Geometry has an intersection with others Elements (not with itself) in the List Entity.

Maybe I have to change the heart of the node and have something like " if element of List Geometry is equal to element of List Entity => don’t check intersection"

But I don’t know what I should do…

Can you give me a hand please?
P.s. I would like to wish a Marry Christmas and a Happy New Years to all the users in this forum!!!

Thanks for your great help and all your support guys!


#2

This might help…

20151224-4


#3

Thanks Vikram,

Your suggestion is nice but I’ve spotted a problem…

Let’s say again that I have a list that contain N parameters A B C D E …(the length of the list is not a standard… it will change)

And let’s say that there is an intersection between the Element A and the element B. If I follow your suggestion, than the node Geometry.Intersect will tell me that there are two intersections:

 

Capture12

 

And this is wrong because there are just one intersection between A and B.

 

What I should do is something like this:

  1. If an element of the List Geometry IS EQUAL to an element of the List Entity => DON’T CHECK INTERSECTION FOR THESE ELEMENTS

  2. If an element of the List Geometry IS DIFFERENT from an element of the List Entity => CHECK INTERSECTIONS:

*The FIRST element of the List Geometry has to check intersections from the SECOND element of the List Entity

*The SECOND element of the List Geometry has to check intersections from the THIRD element of the List Entity

*The THIRD element of the List Geometry has to check intersections from the FOURTH element of the List Entity

*ETC…

*The LAST element of the List Geometry DOESN’T have to check INTERSECTIONS.

 

Graphically I should have something like this:

 

Capture13

 

Thanks for your help Vikram =)


#4

The approach you are suggesting would work if there is only one intersection (per element)

If there are multiple intersections you would be missing out on them.

For example, If A intersects B and also C and/or D then you have a problem.

 


#5

This might work…

Intersect.dyn


#6

Hi Vikram,

Thanks for your massive help!!! =)

You are right, my approach is wrong unfortunately…

 

This is what should be correct:

If the List Geometry has N Elements then:

  1. The first element of the List Geometry has to check N-1 elements of the List Entity

  2. The second element of the List Geometry has to check N-2 elements of the List Entity

  3. The third element of the List Geometry has to check N-3 elements of the List Entity

4)Etc…

  1. The last element of the List Geometry hasn’t to check elements of the List Entity

Capture15

 

 

 

 

 

 

The problem is that if I will have a List like the List Geometry (MODIFIED) and a list like List Entity, then the node Geometry. Intersect will not work correctly because that node will check for each element in the “Geometry inlet” , all the elements in the “Entity inlet” : Capture17

Do you have any suggestion Vikram?

I think that the only way is to create a Python script or modify the Geometry.Intersect node…=(

But how can I do it?..

THANKS VIKRAM


#7

I’ve already provided a solution. Study the definition in the post before yours. I think it does what you’re trying to explain.

To get the number of intersections, count the number of trues.


#8

Dear Vikram,

 

Thanks for your great help!!!

Your solution is really nice! and it works =) It’s possible to check the intersection of different objects…

Now, I would like to improve what I wanted to do…

Let’s say that I have 4 pipes in Revit… (one of them intersects two others pipes)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I would like to put a void family (transparent box) where there is an intersection.

I’ve tried to modify your script for these pipes but it doesn’t work (see attached dynamo file).

Test intersections

The List.Map node shows me this:

Capture19

 

 

 

 

 

 

 

 

 

And the other thing is: how can I show in Revit a transparent box where there is an intersection?

 

I don’t want to ask you again to help me Vikram. You are really kind but I don’t want to bother you anymore with my questions…

Thanks for all your help, you are really good with Dynamo (and you are also a good teacher). I know that I have to improve myself and it will take long time I guess…

(I’ve tried to see if there are some tutorials for MEP but unfortunately there aren’t).

May I ask you when did you start to create dynamo scripts and how long it will takes to be a master like you?

Thanks for everything indeed!!!

Daniele

 


#9

Hi Daniele,

Have a look at this topic http://dynamobim.org/forums/topic/use-linked-mechanical-model-to-create-voids-in-walls/

In your case it will be pipes change category to pipes.

Good Luck!


#10

Daniele, I don’t mind helping often. In any case I do so only when I’m not too busy- which is quite often lately :slight_smile:

Far from being a master or teacher, I’m still very much a student and this forum is my classroom. Thanks for the kind words, though.

Initially it took me a few months of dedicated effort to grasp the basics (I had zero prior experience in scripting/programming), after that it’s been a continuous learning process, mostly by trial and error.

 

As for the pipes, rather than check for intersections, you could find the points of intersections.

The boxes can then be placed at those points. (The below definition does not include this step)

 


#11

Dear Vikram,

You are right, this forum is definitely good!!!

I’ve found very smart and kind people here…All I need now is try to improve my skills and I hope in the future I could help other people… =)

Now I want to improve again the script: I would like to check intersections between pipes and insulation.

I had a look on the link that Kulkul has suggested (thanks indeed!!!) but there is a problem: Let’s say that I have two pipes and one of them have insulation.

If I run this dynamo file: Test2 then Dynamo will show me two intersections:

  1. Intersection between the pink pipe and red insulation ( this is a real intersection)

2)Intersection between the red pipe and the red insulation (this is not a real intersection because the red insulation COVER and not intersect the red pipe). In this case the problem is that External Diameter of the pipe is equal to the Internal Diameter of the insulation so for Dynamo this is an intersection.

I would like to find a solution… What if I will put a condition like:

If the solid centroid of the pipe is equal to the solid centroid of the insulation => don’t check collisions

Do you agree guys? Or what is the best way to do this?

Thanks again guysssssss!!! =)

 

Daniele