Solid.IntersectWithCurve() method doesn't work for beam

Solid.IntersectWithCurve() method doesn't work for beam

Anonymous
Not applicable
1,257 Views
4 Replies
Message 1 of 5

Solid.IntersectWithCurve() method doesn't work for beam

Anonymous
Not applicable

Hi Expert, 

 

I'm trying to check the intersect between beam and pipe. I find there is one good method--Solid.IntersectWithCurve() , which is used to check the intersect between solid and curve. But when I check it in my code, I can't get the intersect, but it is here acturally for I can get it with the existing "Interference Check". 

What I did: 

1. Get Solid object from the FamilyInstance using get_Geometry() method.

2. Get Curve from the pipe using pipe.Location.Curve.

3. Call solid.IntersectWithCurve(curve, options)

 

I tested the logic with the solid of Wall Element, and it works well. But it doesn't for Beam FamilyInstanct, I want to know whether there are different usage for Beam? or this method doesn't support Beam Solid?

 

Thanks, 

Gavin

0 Likes
Accepted solutions (2)
1,258 Views
4 Replies
Replies (4)
Message 2 of 5

ollikat
Collaborator
Collaborator
Accepted solution
Hi

Just a few points of interest...

1) Did you use local wall/beam elements or from the linked document? In case of linked model there's usually a need for coordinate transformation.
2) Have you investigated the structure of the beam element by using Lookup add-in provided by the SDK? If you haven't I strongly recommend doing that. It might give you vital insight about beams geometric structure (although Lookup is not just for geometry and thus very useful in various scenarios...must have tool in Revit API development).

Maybe you have already dealt both of these but...
0 Likes
Message 3 of 5

Anonymous
Not applicable

thanks for your response.

 

About your suggestion:

1. Both beam and wall are in the local rvt file.

2. The structure of Beam is simple, which is concrete rectangular beam. I think the solid I got in my code should be correct. The code I used to get solid is from the help document: Example: Retrieve Geometry Data from a Beam 

 

if it is needed, I can send my sample code to you.

 

thanks,

Gavin

0 Likes
Message 4 of 5

ollikat
Collaborator
Collaborator
OK.

One more trivial thing that came into my mind is that what kind of options are you using while getting the geometry? I mean are you getting the fine detail geometry? I think you should. Also there has been problems with certain categories where this option doesn't have desired effect. Then you should use option to get the geometry based on view specific detail level. You could try this also.

But this is a bit long shot also because you stated that most probably the got solid is fine...
0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

Good information, I can get the correct result. Sorry for late post in this thread.

 

I noticed that I need to do transform for family instance besides the linked document, so, what I did is converting the curve I used to check intersect with beam by transform got from beam family instance. the code snippet :

                    Transform transform = fi.GetTransform();
                    XYZ beginpoint = transform.OfPoint(curve.GetEndPoint(0));
                    XYZ endpoint = transform.OfPoint(curve.GetEndPoint(1));
                    curve = Line.CreateBound(beginpoint, endpoint);

 

Thanks for your patient response for this question.

Gavin