Hello,
i try to get the Intersection of Section and FamilyInstance.
The GeometryElement of the Family returns all Faces, even if they`re outside of the Section.
Is there any predefined function to receive the Solid/BoundingBox inside the Section?
Regards
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
It should be possible, cf.:
https://thebuildingcoder.typepad.com/blog/2011/08/section-view-geometry.html
Hi,
thanks for the link, this will work for me.
I expect to get those Edges with the option.View = viewSection and the GetInstanceGeometry, but this is not the case.
Options option = new Options(); option.ComputeReferences = true; option.View = viewSection; GeometryElement geometryElement = familyInstance.get_Geometry(option); GeometryInstance? gInst = geometryElement.First() as GeometryInstance; GeometryElement gSymbol = gInst.GetInstanceGeometry();
Best regards
Thank you for your answer and confirming that you solved the task and achieved your goal.
What is the crucial point, please?
Is it the fact that you need to specify the section view in the options, and set computeReferences to true?
Does it also work with computeReferences set to false?
Thank you!
Hi,
for me the crucial point was the VIEWER_BOUND_FAR_CLIPPING - Parameter, it was was set to 2 (Clip without line).
I changed it to 1 (Clip with line), now it works as expected.
viewSection.get_Parameter(BuiltInParameter.VIEWER_BOUND_FAR_CLIPPING).Set(1); viewSection.DetailLevel = ViewDetailLevel.Fine
To set the sectionView in the options.View is necessary.
geomOptions.ComputeReferences = false; geomOptions.IncludeNonVisibleObjects = false; geomOptions.View = viewSection;
It works great with ComputeReference set to false too.
Kind regards
Thank you for the details.
I tried to implement a sample demonstrating its use live and have had no success so far.
In my model, the section view is cutting two walls, a door and a window.
Accordingly, I am retrieving four solids (actually, four null and four non-null solids).
I thought I would be getting some curves or something for the cut geometry. Is that incorrect?
I created a repository to show what I tried so far, including my test model:
https://github.com/jeremytammik/SectionCutGeo
Could you check it out and possibly see what I am doing wrong?
Maybe I just need to dig deeper into those four solids?
Thank you!
I updated the repository, checking solid edges and fixing the sketch plane to raw model curves for them, and now I see some of the cut elements: the edges for the walls. I do not see any results for the door and window family instances, however. Do you? Am I still doing something wrong? I updated the repository with the fixes... Thank you!
Sorry, don't worry... just realised I probably need to check the geometry instances as well as top-level solids...
Now I am completely happy with it.
Here are some images from a sample run:
Sample model 3D view:
Plan view showing section location:
Cut geometry in section view:
Model lines representing the cut geometry of the window family instance produced by the add-in in section view:
Model lines representing the cut geometry of walls, door and window isolated in 3D view:
The current source code and Visual Studio solution is in the SectionCutGeo GitHub repository:
https://github.com/jeremytammik/SectionCutGeo
I'll write a blog post with more details anon 🙂
Cheers,
Jeremy
Blog post with the full description is live now:
Thank you for prompting this little exploration.
Cheers,
Jeremy
Hi Jeremy,
I came across your blog post first which directed me here. This looks like a very handy tool, although admittedly, all of the API coding in the article above goes straight over my head. I am looking for a plugin/dynamo script that can take the outlines of things cut in section to help make a filled region. I am currently using Revit 2023/2024. Do you have any advice on installing this addin to work for 2023/2024? I downloaded it from Github but there's no instructions for installing it once I have it. Any advice you could share would be greatly appreciated.
Dear Blob,
Sorry, I can't help very much further here. Glad you like it. I do too! I would love to have the time to take this utility myself and create a handy end-user tool from it, or, alternatively, integrate it into RevitLookup or somewhere similar. However, as it stands, it is just sample source code. So, the only advice I can give you on this is: keep on programming! You'll get there, if you presevere, and then you can do the job yourself. God luck and have fun!
Cheers
Jeremy