Visibility Graphics Settings Dynamo

Visibility Graphics Settings Dynamo

smharch
Advocate Advocate
6,148 Views
10 Replies
Message 1 of 11

Visibility Graphics Settings Dynamo

smharch
Advocate
Advocate

Hello all,

 

I am trying to retrieve category settings from the visibility graphics menu for dynamo. (Line weight, pattern, Fill pattern, ex...) I have managed to get all the settings using the code below. This however give a value of "-1" for default values. How would I go about getting what the default value is set to? 

 

I am very new to the API and coding. 

  

 

import clr

#View to get VG Settings for
view1 = UnwrapElement(IN[0])

#Category to get VG settings from
cat1 = UnwrapElement(IN[1])
VGo = view1.GetCategoryOverrides(cat1.Id)


#VG Settings to output

OUT = VGo.CutFillColor, VGo.CutFillPatternId, VGo.CutLineColor, VGo.CutLineWeight, VGo.CutLinePatternId, VGo.DetailLevel, VGo.Halftone, VGo.IsCutFillPatternVisible, VGo.IsProjectionFillPatternVisible, VGo.IsValidObject, VGo.ProjectionFillColor, VGo.ProjectionFillPatternId, VGo.ProjectionLineColor, VGo.ProjectionLinePatternId, VGo.ProjectionLineWeight, VGo.Transparency

Thank you for any and all help,

0 Likes
Accepted solutions (1)
6,149 Views
10 Replies
Replies (10)
Message 2 of 11

rosalesduquej
Alumni
Alumni
Accepted solution

Hello Shashen,

 

This forum is dedicated to Revit API only. 

 

You may want to try posting to the following forum for Dynamo questions: 

http://dynamobim.com/forums/forum/dyn/

 

People from Dynamo team will probably have more info.  

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes
Message 3 of 11

smharch
Advocate
Advocate

Sorry if I did miss post. I thought this would be the correct spot for this question. 

 

I am wondering how to get around the API returning a "-1" for the default setting. Is there another section I should be referencing rather than GetCategoryOverrides or will it only return "-1" because of the way it is coded on Autodesks end? 

 

Again sorry if this is not the correct spot,

 

Steven

0 Likes
Message 4 of 11

rosalesduquej
Alumni
Alumni

Hi Steven,

 

Sorry but I'm a bit lost to what API you are using. Revit API ? or Dynamo? Like I said, in case you are working with Dynamo please repost the question in the forum url I provided you. If it is Revit API please explain since at the moment it is not clear what you are tryng to do. 

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes
Message 5 of 11

smharch
Advocate
Advocate

Rosalesduquef,

 

I have found this section of the Revit API (Link). I am using it in the code in my first post. It works but it returns "-1" for any default values within the visibility graphics menu. 

For example by default the projection line weight of a wall is “5” however using the API it returns “-1”. I understand it is returning “-1” to signify that it is set to default and has not been changed but I would like to retrieve the default value of “5”.

 

Again sorry if this is not the place for this post,

 

Steven

 

 

0 Likes
Message 6 of 11

rosalesduquej
Alumni
Alumni

Hi Shashen, 

 

Sorry for the delay, What language are you using to code this? It does not seem like C#, or VB which are the ones supported by the Revit API. Now, In case you are can you please send me a minimum ready-to-build sample so I can test in on my side. I will continue checking what you are trying to achieve going over the method you mentioned from the API, again I get confuse with your mentioned of Dynamo here. 

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes
Message 7 of 11

rosalesduquej
Alumni
Alumni

Hi,

 

While I keep researching about it, have you checked out this links https://boostyourbim.wordpress.com/2013/07/12/view-category-overrides/

http://spiderinnet.typepad.com/blog/2013/07/revit-net-creations-api-visibility-control-display-all-g...

 

they are a couple of links using the method of Visibility/Graphic Overrides window from the API. 

 

thanks,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes
Message 8 of 11

smharch
Advocate
Advocate

Rosalesduquej,

 

The script provided was done in Ironpython inside of Dynamo. It uses the API to control Revit from Dynamo. What I posted was a working scrip written in the python node inside Dynamo. 

0 Likes
Message 9 of 11

rosalesduquej
Alumni
Alumni

Hi,

 

So like I said, this is not the right place to post it. Please refer to the link that will take you to the Dynamo forum where you can ask your question. Dynamo and revit API are 2 different API's. 

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes
Message 10 of 11

smharch
Advocate
Advocate

I am sorry. I was unawar that they weere two diferent API's. 

0 Likes
Message 11 of 11

rosalesduquej
Alumni
Alumni

Hi, 

 

That is ok, it happens often 🙂 good luck with your code. Talk to the Dynamo guys, they will put you in the right track. 

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes