문제

I am having a problem with the following statement. I was hoping some could help me?

if (parameter != null && parameter.StorageType == 2 && parameter.HasValue)

도움이 되었습니까?

해결책

Try here for some information on the Parameter.StorageType values: http://spiderinnet.typepad.com/blog/2011/04/parameter-of-revit-api-5-parametertype-and-storagetype.html

You shouldn't really use a "magic" number like 2 here, instead, it should probably be

parameter.StorageType == `StorageType.Double`

Basically, what the line is doing, is making sure, that the parameter

  • was retrieved
  • the value's type is a double, a floating point number
  • has a value

Read the developer documentation on how the parameters work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top