smiledays 发表于 2022-7-6 22:08:26

vba - Grab the intersection po

Hey guys,
 
I wrote to ask for some help about the VBA coding in AutoCAD. I have some circles as well as some lines attached to the edge of each circle in my map. Now I'm supposed to extend the line to the center point of each circle. Since there are thousands of circles in the map, I'd like to use VBA macro to automatically extend the lines one by one.
 
My problem is that how can I grab the intersection point at each circle. I have no idea what command I can use to get the location of the intersection point.
 
The second problem is that some lines even don't rest on the edge of the circle. So I should grab the endpoint closest to each circle and change the right end point to the center of the circle. Is there anyway I can use VBA command to find the nearest endpoint?
 
Note: All the circles and lines are in the pline format.
 
Thanks a lot for your time to see my post. Any suggestions or codes will be highly appreciated!

BIGAL 发表于 2022-7-6 23:48:04

Please post a image or dwg etc so its a bit clearer to understand a before and after. A circle has a centre pt thats easy to find and making a vertice re pline go to center is again easy.
页: [1]
查看完整版本: vba - Grab the intersection po