Element.GetParameterValueByName warning

Element.GetParameterValueByName warning

We get the following warning (see fig. 1).
Presumambly it is the “null” values?


Fig. 1

Does anyone have a solution for this?

Thanks in advance.

Very likely.
Eliminate the nulls by introducing List.Clean (with false for preserve indices) after All Elements of Type

3 Likes

@Vikram_Subbaiah

This fixes the above warning, but I get several warnings later in the script (didn’ have this before ; see fig. 1).
New warnings see fig. 1 and fig. 2.
In fig. 3 you see the previous error. Here you can also see that in the node "code block - viewlist (1) viewlist; " get different data as afther adding the “List.Clean”.


Fig. 1


Fig. 2


Fig. 3

Do you have a solution for this?

Thanks in advance.

Source data:
RVT2021.1.1_JBO_Create-sheets-for-existing-views.dyn (312.4 KB)

You would have to filter the cleaned list, not the original one. Otherwise you’re not only ignoring the nulls, you’re also throwing off your list order.

2 Likes

@Nick_Boyts

I don’t quite understand what you mean.
If I do the filtering afterwards, I still have the warning?


Fig. 1

Hello @j.boonen
try this method with Python (Green frame on the picture)

import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

fecView = FilteredElementCollector(doc).OfClass(View).WhereElementIsNotElementType().ToElements()

OUT = [x for x in fecView if not x.IsTemplate and x.CropBoxActive]

2 Likes

@Vikram_Subbaiah

Thanks!
Problem solved (see fig. 1 and fig. 2) !


Fig. 1


Fig. 2

1 Like

@c.poupin

Thanks for the reply. Is this an alternative for the solution of @Vikram_Subbaiah ?
However, I’m not yet fully involved in your figure. Which node do I need to connect to the Python script / which nodes can I remove?

Thanks in advance!

Hello @j.boonen
yes it’s an alternative solution

1 Like

@c.poupin

Thanks!
This method also works (see fig1 and screencast)!


Fig. 1

Screencast workprocess

1 Like