Graphic styles or discipline

hello is there a way to change the graphic styles, ie wireframe, shaded with edges etc or the discipline ie: Mechanical, Architectural in a given revit view in dynamo? Thanks!

Hi,
There is a custom package called “Visual Style Select”. You can use that to change Visual Styles:

3 Likes

Hello mix,

For the discipline question: Everything in the properties dialiog should be accessible with Element.GetParameterValueByName and if they are not greyed out be set by SetParameterValueByName. Dropdown menus needs an integer as input. If you remeber the numbers you can feed them directly, but maybe it can be nice to use a dictionary in this case:

numbers={1,2,4,8,16,4095};

names=String.Split(
"Architechtural,Structural,Mechanical,Electrical,Plumbing,Coordination", ",");

name2Num[names] = numbers;
name2Num[x];
1 Like

Hello, visual style select does not seem to work for me.

@Einar_Raknes, I dont seem to be able to make your code block work either. See image. Maybe you can explain a little bit more what is happening with those random numbers and names so that I can understand better?

Try this, just feed the views in python node:

Mix,

What I mean is that each discipline corresponds to a number. To set the view to Structrual you need to set the “Discipline” paramter to 2.

The numbers:

1,2,4,8,16,4095

That correstponds to the disciplines:

Architechtural,Structural,Mechanical,Electrical,Plumbing,Coordination

1 Like

@Einar_Raknes - I still dont seem to be able to get your code block code to work. Do I need some package installed?
@Kulkul - Im not sure what you mean by that at all. Ive never used python before. Or what you mean by the (4) you have an arrow going to. Im sorry.

I edited the code, see if it works now.

@Einar_Raknes
Thanks! I got it working now!

@Einar_Raknes How did you ever discover what the parameter values were for those disciplines? They seem so random!

Hint: Element.GetParameterValueByName :wink:

The numbers are not random, they just double each time