Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
299 Views, 6 Replies

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

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!

6 REPLIES 6
Message 2 of 7
Alfred.NESWADBA
in reply to: Anonymous

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 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 7
Anonymous
in reply to: Alfred.NESWADBA

Thanks Alfred

I am referring to 2D spatial maps

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

 

Message 4 of 7
Alfred.NESWADBA
in reply to: Anonymous

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 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 5 of 7
Kent1Cooper
in reply to: Anonymous


@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
Message 6 of 7
leeminardi
in reply to: Anonymous

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
Message 7 of 7
Kent1Cooper
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report