Jump to content

Recommended Posts

Posted (edited)

AcGeCurveCurveInt3d is the tool that does all the heavy lifting, works on any curve type

https://help.autodesk.com/view/OARX/2025/ENU/?guid=OARX-RefGuide-__MEMBERTYPE_Methods_AcGeCurveCurveInt3d

import traceback
from pyrx_imp import Rx, Ge, Gi, Db, Ap, Ed

@Ap.Command()
def doit():
    try:
        filter = [(Db.DxfCode.kDxfStart, "*LINE")]
        ps, ss = Ed.Editor.selectPrompt("Add lines: ", "Remove lines: ", filter)
        if ps != Ed.PromptStatus.eOk:
            raise RuntimeError("Selection Error! {}: ".format(ps))
        curves = [Db.Curve(id) for id in ss.objectIds()]
        for crv1 in curves:
            for crv2 in curves:
                if crv1 == crv2:
                    continue
                gec1 = crv1.getAcGeCurve()
                gec2 = crv2.getAcGeCurve()
                cci = Ge.CurveCurveInt3d(gec1, gec2)
                for idx in range(cci.overlapCount()):
                    iv1, iv2 = cci.getOverlapRanges(idx)

                    # just draw a line showing the overlap
                    Ed.Core.grDraw(
                        crv1.getPointAtDist(iv1.lowerBound()),
                        crv1.getPointAtDist(iv1.upperBound()),
                        1,
                        0,
                    )
    except Exception as err:
        traceback.print_exception(err)

 

overlap.png.880aa84cc78da1640cc07152e2380e43.png

Edited by Danielm103

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...