collect wall info in linked document

collect wall info in linked document

arif.hanif
Contributor Contributor
1,036 Views
8 Replies
Message 1 of 9

collect wall info in linked document

arif.hanif
Contributor
Contributor

can you collect information of a wall in a linked document that is located in a space spatialelement. Basically the boundary condition for the spatial element is a linked document wall.

0 Likes
1,037 Views
8 Replies
Replies (8)
Message 2 of 9

arif.hanif
Contributor
Contributor

i am going to try to use the spatial geometry calculator to determine the faces of the solid object in the host model and then look ray projection ReferenceIntersector..::..FindReferencesInRevitLinks to the linked model but not sure how that would return only the portion of the wall associated with the space in the host model to the wall in the linked model.

0 Likes
Message 3 of 9

augusto.goncalves
Alumni
Alumni
You'll need to call RevitLinkInstance.GetLinkDocument() and use it to filter the boundary you need. Then, back at the main document, do a second filter.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 4 of 9

arif.hanif
Contributor
Contributor

So in my code the first collector finds the spaces and its boundary condition. With the host model you can use GetBoundaryFaceInfo to determine the walls. Are you saying to run that on the revit linked document.

 

UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;

var spaceIds = new FilteredElementCollector( doc ).OfClass( typeof( SpatialElement ) ).ToElementIds();

foreach (var id in spaceIds)
{

var space = doc.GetElement(id) as Space;

var sebOptions = new SpatialElementBoundaryOptions{SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Finish};

var calc = new SpatialElementGeometryCalculator(doc, sebOptions);
var results = calc.CalculateSpatialElementGeometry(space);

Solid spaceSolid = results.GetGeometry();

foreach (Face face in spaceSolid.Faces)
{

IList<SpatialElementBoundarySubface> subfaceList = results.GetBoundaryFaceInfo(face );

foreach( SpatialElementBoundarySubface subface in subfaceList )
{
if( subface.SubfaceType == SubfaceType.Side )
{
Element wall = doc.GetElement( subface.SpatialBoundaryElement.HostElementId );
}
}

0 Likes
Message 5 of 9

augusto.goncalves
Alumni
Alumni
OK, with this new reply (and source code) I don't believe we're on the same page.

First, the FilteredElementCollector demands a document where the element is, so you'll need the GetLinkDocument if plan to get the element.

But I'm not sure what you need here.

An operation on the main document that result on ElementIds that are hosted on a linked document will require the GetLinkDocument to read the element's information.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 6 of 9

arif.hanif
Contributor
Contributor

see below image representation of what i am trying to extract from model. I need to know the subface information from the linked document. So that i may reterieve parameters or geometry information.

0 Likes
Message 7 of 9

arif.hanif
Contributor
Contributor

I will need a workaround but what would solve it is if  SpatialElementGeometryResults.GetBoundaryFaceInfo did not return a null if there was a linked model.

 

 

 

 

 

0 Likes
Message 8 of 9

augusto.goncalves
Alumni
Alumni
Sorry I may be missing something here.. but Revit is not allowing me to create a Space on a wall enclosed area defined in a linked document.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 9 of 9

tf
Contributor
Contributor

@arif.hanif

Hi,

Did you ever get a solution to this?  I am trying to do the same thing with the wall geometry in a linked file.

Anything you can share is greatly appreciated.

Thanks

 

 

0 Likes