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:

2 Likes

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

3 Likes

@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

Very good days.
Sorry, I wanted to know how you found out the codes for each discipline, I mean these:
“Architecture = 1”;
“Structure = 2”;
“Mechanics = 4”;
“Electrical = 8”;
“Plumbing = 16”;
“Coordination = 4095”;
Could you share your source please, thanks.

Hello, here is a way, surely not the most effective


edit: I can’t find the match in the enumerator api, but like Mr. Kulkul’s Python script you have to send Set the No.

Cordially
christian.stan

and another way maybe…

1 Like

indeed super effective Mr. Sovitek (Huggy the good nodes :wink:) and yes I am getting old
cordially
christian.stan

1 Like

hehehe ;)) me to welcome in the club :wink:

1 Like