- 积分
- 13089
- 明经币
- 个
- 注册时间
- 2022-8-12
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2022-9-30 08:55:52
|
显示全部楼层
用这个函数
Gets the points where one object intersects another object in the drawing.
Signature
VBA : RetVal = object.IntersectWith(IntersectObject, ExtendOption)
VL : RetVal = (vla-IntersectWith object IntersectObject, ExtendOption)
(vla-IntersectWith obj1 obj2 acExtendBoth)
Object : All Drawing Objects (Except Pviewport and PolygonMesh)
The object or objects this method applies to.
IntersectObject : Object, input-only;
The object can be one of All Drawing Objects.
ExtendOption : AcExtendOption enum; input-only
This option specifies if one or the other, both, or none of the entities are to be extended in order to attempt an intersection.
acExtendNone
Does not extend either object.
acExtendThisEntity
Extends the base object.
acExtendOtherEntity
Extends the object passed as an argument.
acExtendBoth
Extends both objects.
RetVal : Variant (array of doubles)
The array of points where one object intersects another object in the drawing.
Remarks
If the two objects do not intersect, no data is returned. You can request the point of intersection that would occur if one or both of the objects were extended to meet the other.
Example :
(defun c:al-intersectwith ()
(vl-load-com)
(setq util (vla-get-utility
(vla-get-activedocument
(vlax-get-acad-object))))
(vla-getentity util 'obj1 'ip "\nSelect First Object: ")
(vla-getentity util 'obj2 'ip "\nSelect Second Object: ")
(setq int (vla-IntersectWith obj1 obj2 acExtendBoth))
(princ int)
(princ)
);defun
|
|