Dynamo Python Script Array problem

Dynamo Python Script Array problem

essam-salah
Collaborator Collaborator
156 Views
2 Replies
Message 1 of 3

Dynamo Python Script Array problem

essam-salah
Collaborator
Collaborator

Hi,

I have some code written in .Net and wanted to convert it into Python in Dynamo Python Node, i managed to convert most of it except this line in C#:

var filter = new SelectionFilter(new[] { new TypedValue(0, "INSERT") });

 

the problem is with the Array new[] { new TypedValue(0, "INSERT") } , i tried every possible way to create an array in Python but doesn't work, any Idea

0 Likes
Accepted solutions (1)
157 Views
2 Replies
Replies (2)
Message 2 of 3

hosneyalaa
Advisor
Advisor
Accepted solution

try

 

 #Load the Python Standard and DesignScript Libraries
import sys
from System import Array

                          tv = TypedValue(0,"INSERT")
				tva = Array[TypedValue]([tv])
				selFltr = SelectionFilter(tva)
				acSSPrompt = ed.GetSelection(selFltr)
0 Likes
Message 3 of 3

essam-salah
Collaborator
Collaborator

@hosneyalaa 

it worked, thank u Alaa

0 Likes