Convert Curve into Curve2D

Convert Curve into Curve2D

alexisgacia
Advocate Advocate
1,701 Views
5 Replies
Message 1 of 6

Convert Curve into Curve2D

alexisgacia
Advocate
Advocate

Hi,

 

Sorry to ask this question. I was wondering if there's a function available to convert a Curve into 2D Entity? 

 

Thank you in advance

//Selection

var o = tr.GetObject(oID, OpenMode.ForRead);
if (o is Curve)
{
   Curve mCurve = (Curve)o;

   // Converting to 2D Entity for checking the intersection of objects

}

 

0 Likes
1,702 Views
5 Replies
Replies (5)
Message 2 of 6

_gile
Consultant
Consultant

Hi,

 

As far as I know, the API only provides a Curve.GetGeCurve method which returns a Curve3d object.

To get a Curve2d result, you have to build your own function which have to first check if the Curve object is planar and, if so, pay attention to the plane the curve lies on.

 

If the goal is checking for intersections, the Entity type (which Curve derives from) has an IntersectWith method.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 6

alexisgacia
Advocate
Advocate

I'm trying to check the alignment and the block if they intersect each other. Once the block is intersected in the alignment I will try to project to the profile. 

 

What I did is to exploded the block then convert into 2D same way with the alignment. But I got stuck on converting to 2D. I tried different website to find a solution to convert the 3D to 2D but no avail.

 

 

0 Likes
Message 4 of 6

hosneyalaa
Advisor
Advisor

Hi 

As Idea

Put level block = 0  check intersection with alignment

Then put original level to block 

0 Likes
Message 5 of 6

alexisgacia
Advocate
Advocate

Hi,

 

What I did is to explode the block in the code then I try to intersect with the alignment. But some object not able to intersect, maybe due to the level.

0 Likes
Message 6 of 6

_gile
Consultant
Consultant

You should provide a drawing example with this block and an "alignment".



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes