質問

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