Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Run script for multiple elements (dynamo)

6 ANTWORTEN 6
GELÖST
Antworten
Nachricht 1 von 7
Joos_T
2024 Aufrufe, 6 Antworten

Run script for multiple elements (dynamo)

Hello everyone,

 

I'm trying to add article numbers to a system family. I'm doing this with te same pricipal of a lookup table.

The script I wrote works fine but it only works for one element. 

 

Is there a way I can run this script for multiple elements in a certain category?

 

If I use "Select multiple model elements" the script mixes up all the data.

 

 

Beschriftungen (4)
6 ANTWORTEN 6
Nachricht 2 von 7
L.Maas
als Antwort auf: Joos_T

Yes, check the nodes

LMaas_0-1651221630928.png

After that it is a manner of matching your families with the data. This depends on how everything is structured in your project and lookup table

 

Instead of selecting elements you also can do something like

LMaas_0-1651221986313.png

 

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Nachricht 3 von 7
Joos_T
als Antwort auf: L.Maas

Thanks for your reply.

That's what tried first. If I use this Node it mixes up all the data of all the elements.

It has to run every element separately.

Nachricht 4 von 7
L.Maas
als Antwort auf: Joos_T

Consider uploading your script, your csv and small sample of your project so that we can see how everything is structured.

 

Basically it is that you create two sets of data (elements in revit, elements in your csv). Then you collect those data in two lists. Then you will need to find a way to match those two lists (which Revit element belongs to which entry in the csv). This can only be figured out if we have clear understanding how both are organized and if there is a key to matching both

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Nachricht 5 von 7
Joos_T
als Antwort auf: Joos_T

I've made a sample file for you.

Thanks for helping me out.

 

Nachricht 6 von 7
L.Maas
als Antwort auf: Joos_T

Study this script (added). This should bring you a long way

LMaas_0-1651228080998.png

I basically did:

-Made a "dictionary" (searchkey, value) by merging the three search keys (mat, diam, length) into a single element.

-Doing the same with the revit data.

-Doing a lookup of the search key in the dictionary, getting the matching artikelnummer

-Writing the artikelnummer back to Revit

 

You must finetune it for your case.

Also pay attention to "exceptions" (e.g upper/lower characters in CSV or Excel)

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Nachricht 7 von 7
Joos_T
als Antwort auf: Joos_T

This is just what I needed. Thanks for your help!

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report