Export data through the air

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

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

1 Like

unfortunately , in this links not decision to my question

Get-list-values-3

no !))))

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

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

1 Like

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

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

1 Like

this my amazing code


OUT=IN[0]

@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

I will die if you not understand me

We are doing our best

im so happy…

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…

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

That would be a good idee indeed…

exactly…:sunglasses:

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

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.