Export data through the air

dynamo
#5

im want to get list from def code block for use them later

0 Likes

#6

I figure out that you are in fact looking for this:

1 Like

#7

unfortunately , in this links not decision to my question

0 Likes

#8

Get-list-values-3

0 Likes

#9

no !))))

im exactly need get lists from elements out of PythonScript ))
its really trouble i think :smiling_imp: :neutral_face:

0 Likes

#10

You can paste and format your code here with this button:
Format-code
Here is how:

1 Like

#11

ok)
if im have the elements can i return they in code block ?

0 Likes

#12

@til.shviger Paste the code as @Yna_Db requested. You need to paste the code if you want others to help you.

1 Like

#13

this my amazing code


OUT=IN[0]

0 Likes

#15

@til.shviger Is this your code?

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
 
# библиотека динамо для работы с ревитом
clr.AddReference('RevitServices')
import RevitServices
 
# Использование библиотеки DSCoreNodes (основные ноды расположенные на вкладке библиотеки слева в разделе Core)
clr.AddReference("DSCoreNodes") # DSCoreNodes.dll лежит здесь C:\Program Files\Dynamo\Dynamo Core\1.3
import DSCore
clr.ImportExtensions(DSCore)
from DSCore import *

import itertools

#Назначьте вывод переменной OUT.
list_ps=[]
list_fs=[]
list_elbow=[]
list_tee=[]
list_z=[]

#filter pipes
list_ps=[i for i in IN[0] if i.GetCategory.Name=="Трубы"] 
#filter pipes fittings
list_fs=[i for i in IN[0] if i.GetCategory.Name=="Соединительные детали трубопроводов"]     


       
#get intersectioon fittings with pipes
for k in list_fs:
	for j in list_ps:
		if k.BoundingBox.Intersects(j.BoundingBox)==True:
			sublist= [k, j]        
			list_z.append(sublist) 
lst=sorted(list_z, key=lambda x: x[0] )

#Sort pipes from fittings
 
ps = dict()
for x in lst:
    p = x[0]
    if p in ps:
        ps[p].append(x[1])
    else:
        ps[p] = [x[1]]
result = sorted([v for k,v in ps.items()], key = lambda x: x[0])
 
# elbow and tee lists
#for i in result:
#    if i.Count==2:
#        list_elbow.append(i)
#    else:
#        list_tee.append(i)
#

OUT = result
0 Likes

#16

0 Likes

#17

I will die if you not understand me

0 Likes

#18

We are doing our best

0 Likes

#19

im so happy…

0 Likes

#20

I have never seen anything like that and I am not that advanced with Python to be able to find any quick solution. But I am sure that someone else will have a clearer idee on it…

0 Likes

#21

Yna_Db,
thanks for your time)
in out of python may be list of elements or values it is not important
important its transmit data between code blocks or python without connectors (wires) which looks like spiderweb when is exist many code blocks

0 Likes

#22

That would be a good idee indeed…

0 Likes

#23

exactly…:sunglasses:

0 Likes

#24

This has been a long thread… trying to add clarity here: there are no current methods for sending data wirelessly that I know of other than with the Prorubim package and that can only set out of the box inputs. If you have a Flux account you can send any kind of data to the webs and recieve it in the same script.

2 Likes

#25

Perhaps clipboard send to and clipboard get from? Would need to convert to element IDs to numbers, and the array to a string, and then back again. Also you will only be able to do this once per graph.

0 Likes