How to hide the Text with text type "2.5mm Arial" in the current view using revit api command?

How to hide the Text with text type "2.5mm Arial" in the current view using revit api command?

jadhavabhi309
Explorer Explorer
564 Views
4 Replies
Message 1 of 5

How to hide the Text with text type "2.5mm Arial" in the current view using revit api command?

jadhavabhi309
Explorer
Explorer

How to hide the Text with text type "2.5mm Arial" in the current view using revit api command?

 

Here is my sample code in python

 

 

temp =[]
fec = FilteredElementCollector(doc).OfClass(TextNoteType)#.ToElements()
ElementIDS = fec.ToElementIds()

for i in fec:
    name = i.LookupParameter("Type Name").AsString()
    if name == "2.5mm Arial":
        temp.append(name)
    

0 Likes
Accepted solutions (1)
565 Views
4 Replies
Replies (4)
Message 2 of 5

moturi.magati.george
Autodesk
Autodesk
Accepted solution

Hi @jadhavabhi309,

 

To hide elements in Revit, check if the element can be hidden first using  CanBeHidden method

https://www.revitapidocs.com/2015/5e4e0eb6-7328-49b0-d4d0-59729777114d.htm

 

Then call the HideElements Method to hide the collection of element ids

https://www.revitapidocs.com/2015/6b0ae8d1-776a-ad0d-577d-ffdc11673019.htm

 

 

 

  Moturi George,     Developer Advocacy and Support,  ADN Open
Message 3 of 5

jeremy_tammik
Alumni
Alumni

Are you sure you really want to do this? I would assume that there are view settings that can be used to achieve this with less effort and total end user control.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 5

jadhavabhi309
Explorer
Explorer

Thank you for responding .What do you mean by view setting and what are they?

Message 5 of 5

jeremy_tammik
Alumni
Alumni

https://duckduckgo.com/?q=revit+view+setting

  

https://help.autodesk.com/view/RVT/2023/ENU/?query=view%20settings

    

As you can tell from the number of results, this is a rather important and fundamental aspect of using Revit.

  

I doubt that anyone can use Revit effectively without understanding view settings.

  

And, as said, it proper use of view settings may enable a much more effective and user-friendly approach to solve your task. Whatever that task may be...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open