Get node names as string in current .dyn file

francolaca

1m

hi,

Is there any way to do it for Civil3D dynamo? can you help me with the python code block

Thanks for help !!!

1 Like

Here ya go!

nodeNames

import clr

clr.AddReference('AcDynamo')

from Autodesk.AutoCAD.DynamoApp import *

currentWorkspace = AcDynamoRuntime.DynamoModel.CurrentWorkspace

nodeNames = []

for i in currentWorkspace.Nodes:
	nodeNames.append(i.Name)

OUT = nodeNames
3 Likes

Hi @zachri.jensen,

What a quick response!!! You are becoming my reference within the forum :smiley: :smiley: :smiley:

I wonder if this can be done but only with nodes in a certain node group. For example, if there is a node group called Group1 that contains nodes node1_1 , node1_2 , node1_3

the script has to return only the node names within the Group1

Is there any way of doing this?

There’s always a way with enough time :wink:

I’m sure you can dig into the CurrentWorkspace class and find what you need for node groups. Sounds like good practice.

2 Likes