Set Parameter by Name using Design Script

Hi all,

I’ve got a list of geometry (with 4 sub-lists) who’s material parameter I’m trying to set by name using design script. I keep getting " Revit.Elements.SetParameterByName() is not a static function". Not entirely sure what that means hoping someone can shed some light on this.

Additionally I would also like to set the subcategory for each of the sub-lists using design script.

@Vikram_Subbaiah any suggestions?

Thanks,
Krishna

1 Like

@Krishna_Duddumpudi I don’t think you don’t really need an Imperative code block

In any case this should help …
20170824-3

The design script equivalent of the node below should help do that …
20170824-3A

1 Like

@Vikram_Subbaiah,

Thanks a lot for your quick response! Unfortunately I didn’t have much luck with your suggestion. It simple didn’t end up changing the material. In part my trouble is understanding some basic syntax in design script :sweat_smile:

The Springs.Form.ByGeometry node at the top left, basically returns 4 lists of solids which contain a total of 928 solids, the four lists correspond to four layers in Rhino. There will be additional layers in the future so what I’m trying to achieve through the code block is some optimization where I can run the dynamo script > geometry is read > materials assigned and sub categories assigned in one go.

Ideally if the material doesn’t exist then a default material gets created with the appropriate name and assigned to the geometry. But first steps first I guess!

So I’ve currently achieved this by stringing these nodes like so :

But as you can see if I end up having 10 or 20 layers in the end, this is going to be very painful!

Any suggestions would be appreciated! Thanks in advance,

Krishna

Hi

You could try node to code.

Marcel

@Krishna_Duddumpudi Well, you don’t need to have a separate node to assign a different parameter value to each sublist. You could leave the list of elements alone, combine the parameter values in a list and feed them in like this …

Yeah, seems like FamilyType.ByGeometry is still a work in progress. Doesn’t seem to assign materials.

Thanks for your help Vikram!

@Marcel_Rijsmus cheers for the suggestion. Unfortunately it seems not all code blocks can be translated using node to code, particularly for libraries / packages.

1 Like

@Krishna_Duddumpudi
@Vikram_Subbaiah

Yeah i know .
Wouldnt it be great to call on a Node in designscript by using Springs.Tada.Tada(input A, input B, input C) :slight_smile:

Marcel

1 Like