Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Intersection of two spatial elements (area and area OR area and a line)?

Anonymous

Intersection of two spatial elements (area and area OR area and a line)?

Anonymous
Not applicable

Hello forum

Is it possible to identify the intersection of two spatial elements using scripts or single commands? 

I am looking for simple commands/script that will assist in a batch automation.

Thanks!

0 Likes
Reply
428 Views
6 Replies
Replies (6)

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

if you are referring to 3D and so where a line goes through a 3D surface then sorry no.

Creation of an edge where two 3D surfaces are intersecting can be done using command _INTERFERE

 

If you need something else then please create a dwg-file with that parts you want to check and let us know which result you are looking for.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

Anonymous
Not applicable

Thanks Alfred

I am referring to 2D spatial maps

eg. finding the intersection of a given plot area and a high-way for instance 

 

0 Likes

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> finding the intersection of a given plot area and a

>> high-way for instance 

As that can have multiple intersections you need to write your tool to find all intersection points and handle all them then in your script.

There does not exist a command that returns multiple intersection points between 2 3D entities.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... the intersection of two spatial elements ....


If they're objects like Polylines, Lines, Arcs, Regions, Circles, etc., and if "2D" means they're always in the same plane, try this [in simplest terms]:

 

(vl-load-com)
(defun C:GetIntof2 (/ obj1 obj2) (setq obj1 (vlax-ename->vla-object (car (entsel "\nSelect 1st object: "))) obj2 (vlax-ename->vla-object (car (entsel "\nSelect 2nd object: "))) ) (vlax-invoke obj1 'IntersectWith obj2 acExtendNone) )

That will return a plain undifferentiated list of the XYZ coordinates of any intersection point(s), such as this:

 

(23.2811 12.8557 0.0 21.0864 11.7895 0.0)

 

The test situation had two things that intersect twice -- the first 3 numbers there are the XYZ of one intersection, and the last 3 are the XYZ of the other.  There could be 3 numbers, or 9, or....  The list can be put into a variable.  The points in it can be pulled apart into separate point lists if needed, also stored into variables for use in further code.

Kent Cooper, AIA
0 Likes

leeminardi
Mentor
Mentor

If you are working in 2D then define regions for the highways and the land plots then do a Boolean Intersect which will yield the areas of intersection.  For example, on the left are two regions and the right shows the intersection areas.  You can then give the area object  command to find the amount of intersection.

image.png

If you are working in 3D then the object must be solids before giving the intersect command.

 

 

lee.minardi
0 Likes

Kent1Cooper
Consultant
Consultant

Clarify something:

 

Looking at the Topic wording, I assumed [because of the word "line" at the end] that you meant intersection points  of the linear aspects [edges in the case of something with area, such as a Region or Circle or closed Polyline].  That's what the "intersectwith" method in AutoLisp gives you.  But @leeminardi assumed you meant areas  of what I would term "overlap."  That's what the INTERSECT command gives you between appropriate things, so it's a legitimate interpretation of the word "intersection," but is it what you mean?  Between an area and a line, what could that mean?

Kent Cooper, AIA
0 Likes