Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Revit API

$
0
0
I have a series of sheets with 1 titleblock in each sheet, I am trying to get sheet height and sheet width from each sheet.


Code:

ForEach m_Views In VS

Dim a AsFilteredElementCollector
Dim h AsParameter
Dim w AsParameter
Dim s AsParameter
 
a = NewFilteredElementCollector(doc)
a.OfCategory(BuiltInCategory.OST_TitleBlocks)
a.OfClass(GetType(FamilyInstance))

                   
Dim sheetHeight AsString = ""
Dim sheetWidth AsString = ""
Dim sheetNumber AsString = ""
       

       
For Each x As FamilyInstance In a


s = x.Parameter(BuiltInParameter.SHEET_WIDTH)
Debug.Assert(w IsNotNothing, "expected valid sheet width")
Dim swidth AsString = s.AsValueString()
Dim width AsDouble = s.AsDouble()

 
w = x.Parameter(BuiltInParameter.SHEET_WIDTH)
Debug.Assert(s IsNotNothing, "expected valid sheet width")
Dim swidth AsString = w.AsValueString()
Dim width AsDouble = w.AsDouble()

 
h = x.Parameter(BuiltInParameter.SHEET_HEIGHT)
Debug.Assert(h IsNotNothing, "expected valid sheet height")
Dim sheight AsString = h.AsValueString()
Dim height AsDouble = h.AsDouble()

 
sheetNumber = snumber
sheetHeight = sheight
sheetWidth = swidth

                   
Next

 
MsgBox(sheetNumber & " " & sheetHeight & " " & sheetWidth)

 
Next

I have 3 Sheets in my Project, and the message box returns Sheet number, sizes and heights for each sheet, I wondered if someone could help me achieve only returning sheet height and width for drawing based on sheet number.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>