Danielm103 Posted February 4, 2025 Posted February 4, 2025 (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) Edited February 4, 2025 by Danielm103 Quote
Recommended Posts
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.