c# - Get all building Elements with quantity and unity - Revit Api -


for export add-in on revit 2014, need building elements in opened project.

to elements, using logicalfilter :

new logicalorfilter(new elementiselementtypefilter(true),new elementiselementtypefilter(false)); 

then parse them using filters on category id, using element.category.id.integervalue compare every elements in arrays.

i can elements, parameters missing:

  • how many elements of type have? (like n doors).
  • wich unity should use (m2, m3, m, kg, etc)
  • wich materials in element? (i know can element's materialids using getmaterialids() method, seems returns materials, not of them)

also, when elements, elements does'nt have name, or meanless name "300x75", not element name (wood door example).

supamiu, of depends on you're trying do. logicalorfilter you're using pull in every element - whether "type" element or "instance" element (and others neither, families, materials, etc).

  • to investigate how many doors have, you'll need count instance elements of particular category. in experience, "family"-type elements, might not valid element category, , must navigate familyinstance->familysymbol->family , check "familycategory" property. also, run elements in filter have null category (usually weird, internal elements).

  • the unit type stored in each parameter's definition (i.e. length, area, text, etc), displayunittype, enum has of available display options.

  • i believe element.getmaterialids() reflection of of materials present in instance elements, @ least.

good luck, matt


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -