Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Floor geometry

1 REPLY 1
Reply
Message 1 of 2
Anonymous
1218 Views, 1 Reply

Floor geometry

Anonymous
Not applicable
Hello,

I hope someone can hel because I searched ADN network and could not find any help. I am creating the code below so that it reads floor object sin the model and then extract these information: thickness, boundary points (xyz), area, but I could not get the geometry information.

Any help is really really appreciated.

## START CODE ##

Public Function Execute( _
ByVal commandData As Autodesk.Revit.ExternalCommandData, _
ByRef message As String, _
ByVal elements As Autodesk.Revit.ElementSet) _
As Autodesk.Revit.IExternalCommand.Result _
Implements Autodesk.Revit.IExternalCommand.Execute

Dim doc As Autodesk.Revit.Document = commandData.Application.ActiveDocument
Dim eleSet As ElementSet = doc.Selection.Elements
Dim ele As Autodesk.Revit.Element
Dim itr As Autodesk.Revit.ElementIterator = doc.Elements

sel = doc.Selection

sMsg += "There are " & sel.Elements.Size & " elements in the selection set:"

MsgBox("A4!")



Try
If eleSet.Size < 1 Then

MsgBox("Please select an element!")
Exit Function
End If

Do While itr.MoveNext
ele = itr.Current
If TypeOf ele Is Autodesk.Revit.Elements.Floor Then
MsgBox(" new floor loop")
Dim aFloor As Autodesk.Revit.Elements.Floor = ele
Dim layer As Autodesk.Revit.Structural.CompoundStructureLayer

MsgBox(ele.Category.Name.ToString & " 1")
MsgBox(aFloor.Id.Value.ToString & " 2")
MsgBox(aFloor.Parameter(BuiltInParameter.FLOOR_THICKNESS_PARAM).ToString & " 3")


End If

Loop

Catch ex As Exception
MsgBox(ex.Message & "exception")
End Try

Return IExternalCommand.Result.Succeeded
End Function

## END CODE ##
0 Likes

Floor geometry

Hello,

I hope someone can hel because I searched ADN network and could not find any help. I am creating the code below so that it reads floor object sin the model and then extract these information: thickness, boundary points (xyz), area, but I could not get the geometry information.

Any help is really really appreciated.

## START CODE ##

Public Function Execute( _
ByVal commandData As Autodesk.Revit.ExternalCommandData, _
ByRef message As String, _
ByVal elements As Autodesk.Revit.ElementSet) _
As Autodesk.Revit.IExternalCommand.Result _
Implements Autodesk.Revit.IExternalCommand.Execute

Dim doc As Autodesk.Revit.Document = commandData.Application.ActiveDocument
Dim eleSet As ElementSet = doc.Selection.Elements
Dim ele As Autodesk.Revit.Element
Dim itr As Autodesk.Revit.ElementIterator = doc.Elements

sel = doc.Selection

sMsg += "There are " & sel.Elements.Size & " elements in the selection set:"

MsgBox("A4!")



Try
If eleSet.Size < 1 Then

MsgBox("Please select an element!")
Exit Function
End If

Do While itr.MoveNext
ele = itr.Current
If TypeOf ele Is Autodesk.Revit.Elements.Floor Then
MsgBox(" new floor loop")
Dim aFloor As Autodesk.Revit.Elements.Floor = ele
Dim layer As Autodesk.Revit.Structural.CompoundStructureLayer

MsgBox(ele.Category.Name.ToString & " 1")
MsgBox(aFloor.Id.Value.ToString & " 2")
MsgBox(aFloor.Parameter(BuiltInParameter.FLOOR_THICKNESS_PARAM).ToString & " 3")


End If

Loop

Catch ex As Exception
MsgBox(ex.Message & "exception")
End Try

Return IExternalCommand.Result.Succeeded
End Function

## END CODE ##
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

Jeremy Tammik, The Building Coder has a great explanation of this and code samples here:

http://thebuildingcoder.typepad.com/blog/2008/11/editing-a-floor-profile.html

 

You should check it out.

 

 

 

0 Likes

Jeremy Tammik, The Building Coder has a great explanation of this and code samples here:

http://thebuildingcoder.typepad.com/blog/2008/11/editing-a-floor-profile.html

 

You should check it out.

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report