# Changing multiple parameters using "AppliedSubassembly.SetParameterByName"

**URL:** <https://forum.dynamobim.com/t/changing-multiple-parameters-using-appliedsubassembly-setparameterbyname/42744>\
**Category:** Civil 3D\
**Tags:** excel\
**Created:** [November 5, 2019, 9:51am UTC](https://forum.dynamobim.com/t/changing-multiple-parameters-using-appliedsubassembly-setparameterbyname/42744 "2019-11-05T09:51:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggbphpy](https://avatars.discourse-cdn.com/v4/letter/g/d78d45/32.png) [@ggbphpy](https://forum.dynamobim.com/u/ggbphpy)\
**Post date:** [November 5, 2019, 9:51am UTC](https://forum.dynamobim.com/t/changing-multiple-parameters-using-appliedsubassembly-setparameterbyname/42744/1 "2019-11-05T09:51:08Z")

</div>

Hi everyone, I am new to Dynamo for Civil 3D, and trying to connect this powerful tool with excel. Specifically, I want to read multiple corridor subassembly parameters from excel, and updating these parameters (and subsequently corridors) at one time.

(1) Do we have a functionality dedicated to this? It seems that we have the functionality to update “only one” parameter of a subassembly (AppliedSubassembly.SetParameterByName), but we do not have the one to update “multiple” parameters at one time.

(2) I have made a custom node which extends “AppliedSubassembly.SetParameterByName” and updates multiple subassembly parameters at one time, which is shown below.

```auto
# Load the Python Standard and DesignScript Libraries
import sys
import clr

# Add Assemblies for AutoCAD
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')

# Add Assemblies for Civil3D
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')

# Add Assemblies for Dynamo (Additional)
clr.AddReference('Civil3DNodes')

# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

# Import references from Civil3D
from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

# Import references from Dynamo (Additional)
from Autodesk.Civil.DynamoNodes import AppliedSubassembly

def SetParameters(appliedSubassembly, data):

	# Magical spells ...
	adoc = Application.DocumentManager.MdiActiveDocument
	editor = adoc.Editor

	with adoc.LockDocument():
		with adoc.Database as db:
			with db.TransactionManager.StartTransaction() as t:

				# Update for each subassembly type, section, and parameter 
				for i in range(len(appliedSubassembly)):
					for j in range(len(appliedSubassembly[i])):
						for k in range(len(data[i])):
							AppliedSubassembly.SetParameterByName(appliedSubassembly[i][j], data[i][k][0], data[i][k][2], 0)

				# Commit before end transaction
				t.Commit()
				# pass

OUT = SetParameters(IN[0], IN[1])

```

The .dyn file and .dwg file is attached below.  
[Subassembly\_Params\_Import.dyn](https://forum.dynamobim.com/uploads/short-url/3aBSS2GAAadmd7uAYeIfQ8vwuIK.dyn) (40.8 KB)  
[Subassembly\_Params.dwg](https://forum.dynamobim.com/uploads/short-url/dDhWLjS5VxNwqJl0CTJZetvgDlr.dwg) (1.4 MB)

All I am doing is run “AppliedSubassembly.SetParameterByName” iteratively. But the program gives me an error on reaching to non-editable parameters, so I need to manually get rid of these from excel in advance.

Do you know any workaround on it? (For example, finding out non-editable parameters before running “AppliedSubassembly.SetParameterByName”, or picking up only editable parameters extending “SubassemblyParameter.Name”, etc.)

I would appreciate any kind of replies!

---

<div class="post-metadata">

**Author:** ![Drbohlav](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/drbohlav/32/113004_2.png) [@Drbohlav](https://forum.dynamobim.com/u/Drbohlav)\
**Post date:** [October 25, 2020, 8:10pm UTC](https://forum.dynamobim.com/t/changing-multiple-parameters-using-appliedsubassembly-setparameterbyname/42744/2 "2020-10-25T20:10:03Z")

</div>

> [@ggbphpy](#):
>
> `appliedSubassembly`

You can use List.Map node for this, if you use AppliedSubassembly.SetParameterByName node as a function.

 ![AppliedSubassembly.SetParameterByName](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/f/dfe59a41ab414fd2e2ca045fffa9135335cba99f.jpeg)  
Best regards  
Lukas
