天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 29|回复: 0

AutoLisp生成统一平面的计算交点

[复制链接]
  • TA的每日心情
    开心
    3 天前
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    99

    主题

    11

    回帖

    1234

    积分

    管理员

    积分
    1234
    QQ
    发表于 2024-9-27 18:46:20 | 显示全部楼层 |阅读模式
    [生成统一平面的计算交点,再返回到线上,但存在个bug,vlax-curve-getClosestPointTo 是垂直方向最近点,存在狠斜时坐标返回错位,使用vlax-curve-getClosestPointToProjection,部分情况下投影点也错了,还有其他方法吗


    1. (defun getIntersectwith        (obj          cutobj   /            typ             cpobj
    2.                          pte          pts           ptc            intPoints
    3.                          entobj          entcpobj objlen   ptcls    FunMap
    4.                          ptdt
    5.                         )
    6.   (defun FunMap        (x)
    7.     (vlax-curve-getClosestPointTo
    8.       obj
    9.       (ZC_GETCLOSESTPOINTTO obj x)
    10.       t
    11.     )
    12.   )
    13.   (setq intPoints (vlax-invoke obj 'intersectwith cutobj acextendnone))
    14.   ;;获取交点
    15.   (if (or (not intPoints) (= (type intPoints) vlax-vbEmpty))
    16.     (progn
    17.       (setq cpobj (CopynewObj obj))
    18.       (setq typ (vla-get-ObjectName obj))
    19.       (cond
    20.         ((MEMBER typ '("AcDbPolyline" "AcDb2dPolyline"))
    21.          (VLA-PUT-ELEVATION cpobj 0)
    22.         )
    23.         ((= typ "AcDbLine")
    24.          (set3dPtToZero cpobj "StartPoint")
    25.          (set3dPtToZero cpobj "endPoint")
    26.         )
    27.         ((MEMBER typ '("AcDbArc" "AcadEllipse"))
    28.          (set3dPtToZero cpobj "StartPoint")
    29.          (set3dPtToZero cpobj "endPoint")
    30.          (set3dPtToZero cpobj "Center")
    31.         )
    32.         ((= typ "AcDbCircle")
    33.          (set3dPtToZero cpobj "Center")
    34.         )
    35.         ((MEMBER typ '("AcDb3dPolyline" "AcDbMLine"))
    36.          (set3dPtstoZero cpobj "Coordinates")
    37.         )
    38.         ((= typ "AcDbSpline")
    39.          (set3dPtstoZero cpobj "FitPoints")
    40.         )
    41.         ((MEMBER typ '("AcDbRay " "AcDbXline "))
    42.          (set3dPtToZero cpobj "BasePoint")
    43.          (set3dPtToZero cpobj "SecondPoint")
    44.         )
    45.       )
    46.       (setq intPoints
    47.              (vlax-invoke cpobj 'intersectwith cutobj acextendnone)
    48.       )
    49.       (if (setq intPoints (LST3D->PTLIST intPoints))
    50.         (setq intPoints (mapcar 'FunMap intPoints))
    51.       )
    52.       (vla-delete cpobj)
    53.       (vl-remove 'nil intPoints)
    54.     )
    55.     (LST3D->PTLIST intPoints)
    56.   )
    57. )
    复制代码

     

     

     

     

    AutoLisp生成统一平面的计算交点
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

    GMT+8, 2024-10-27 08:24 , Processed in 0.150293 second(s), 22 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表