« Find an Element in an Area | Main | Creating a Dimension Label »

February 02, 2010

Comments

Jeremy,

Can you remind me - the latest APIs still don't support split faces, correct?

Dear Matt,

I have not seen any update on this, nope.

cheers, Jeremy.

Hi Jeremy,

have you any idea on how the extract exact quantities of materials in walls?

When I saw methods
Element.GetMaterialVolume and
Element.GetMaterialArea I thought they are very useful, but unfortunately they are not very accurate. These methods calculate areas/volumes badly on L or T joints. They do not calculate parts of materials in adjecent wall.

Dear Dragan,

The Revit API does not seem to provide any more detailed analysis or volume calculation access than the methods you mention.

If you are interested in more precise results, you might have to perform some additional geometric analysis yourself, for instance along the lines presented for determining the interior wall component layer geometry:

http://thebuildingcoder.typepad.com/blog/2009/02/compound-wall-layer-volumes.html

Cheers, Jeremy.

Hi Jeremy,

Do u know abt any plugins which can extract the 3D geometric information from revit including the IFC data format

Dear Asheshrocky,

Nope.

Cheers, Jeremy.

Hi Jeremy,
I find this very, very usefull. Tanks

I meant Thanks!! (not tanks) ;)

Dear José,

Thank you for your appreciation! Most of the thanks is due to Scott, of course!

Cheers, Jeremy.

Hi Jeremy,

When I am trying to execute the below code, I got the error. Please help me in correcting the code.

Public Sub WallfromLine()
'Prompt user to select level for new walls
Dim curlevel As ElementId
curlevel = Me.Selection.PickObject(ObjectType.Element,"Select level for new wall").ElementId
'Create collection of all line elements in the current project file
Dim curcollector As New FilteredElementCollector(Me.Document)
curcollector.OfCategory(BuiltInCategory.OST_Lines)
'Loop through the elements - if element is a model line, create a wall
For each curelem In curcollector.ToElements
            If curelem.Name Like "Model Lines" Then
                'Convert element to model line    
                Dim curline As ModelLine
                curline = curelem
                'Create transaction and insert wall using current wall type
                Using t As New Transaction(Me.Document,"Add new wall")
                If t.Start = TransactionStatus.Started Then
                    'Create a new wall    
                    Dim newWall As Wall
                    newWall = Wall.Create ( Me.Document, curline.GeometryCurve, curlevel, False )
                End If
                'Commit changes
                t.Commit()
                End Using
            End If
            Next         
    End Sub

Regards,
Neelima

Dear Neelima,

I see a number of interesting issues with your code.

The first is that you appear to be picking an arbitrary building element using PickObject and assigning its element id to the curlevel variable, which is assumed to be the element id of a level. Since that will never be the case, the call to create the wall will presumably fail.

I would suggest working through the getting started material first:

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

While working through that, you will get the hang of using the Visual Studio debugger and the RevitLookup database exploration tool.

With these in hand, you will be well equipped to make further progress.

Cheers, Jeremy.

Thank you so much Jeremy.

Will follow the link you shared.

Thanks,
Neelima

Hey there,

Sorry for this 4-years-after comment but i have a problem with one of your link, the one we need to get scott's material AU class is broken, so i can't try this one without it, can you please fix it?

Dear Miu,

Thank you for your very valid request.

Scott's sample code described above was promoted to an official Revit SDK sample, MaterialQuantities, and mentioned here and there in subsequent discussions, e.g.:


Material Quantity Extraction
Selecting Model Elements
Model Elements Revisited
Wall Joins and Geometry
The Temporary Transaction Trick for Gross Slab Data
Attributes, Relationships and Other Stuff


So you can grab the updated sample code from the SDK.

Regarding the AU class handout, I just added it to the post above:

http://thebuildingcoder.typepad.com/blog/2010/02/material-quantity-extraction.html#2

It does not say anything specific about the MaterialQuantities sample, though.

I hope this helps.

Cheers, Jeremy.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource