Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

'IntersectWith not finding all intersections with spline

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
GCIIEvan
1045 Views, 5 Replies

'IntersectWith not finding all intersections with spline

Hi everyone,

 

I've been scratching my head about this for too long. I have a LSP file (see attached) that is supposed to find the intersection points between vertical spacing lines and a profile that spans the lines. With those points, it finds the coordinate and slope at each point, plots a polyline as a check, and outputs the values to an Excel file.

 

I've run into a situation a handful of times with a setup of spacing and profile lines (example attached), where the program just isn't finding all of the intersection points. In this file, you'll see a bunch of vertical spacing lines, a profile spline, and the resulting "check" polyline (on layer "0"). It's with the "check" polyline that it is most obvious which intersection points it isn't finding, because the polyline jumps.

 

The spacing lines definitely intersect with the spline. I've verified everything to be at elevation 0. I've copied and replaced each of the elements. I just don't know why it's not finding the intersection points. I assume it's related to the spline somehow, but I don't know if or how.

 

As a consequence, when it draws the polyline and populates the Excel sheet, it reverts to the last value when it cannot find one. So, multiple points exist on the spacing lines just before it skips a bunch. This isn't a big deal to me right now.

Any help is very much appreciated.

Thanks.

Oh, if you want full functionality, the program loads the external program "getExcel", which I found here. An alert appears each time it loads a new worksheet, but simply acknowledging works fine.

5 REPLIES 5
Message 2 of 6
dbroad
in reply to: GCIIEvan

Interesting and puzzling.  It does seem to be something wrong with the spline rather than the lines.  Certain regions of the spline won't intersect wtih anything else drawn using intersectwith.  The intersect osnap has no problem though.  Must the profile be a spline rather than a polyline?

Architect, Registered NC, VA, SC, & GA.
Message 3 of 6
GCIIEvan
in reply to: dbroad

Thanks for the reply. I was afraid the issue would not be reproducible.

Yes, unfortunately we cannot avoid using a spline in many situations, based on the exact shape we're trying to create. Perhaps we could convert to a polyline with high precision if need be, but it's a bit frustrating to have to go from exact to approximate with any of our data.
Message 4 of 6
phanaem
in reply to: GCIIEvan

Use acExtendNone and make sure every line crosses the profile curve. I've made this change in your lisp and everything seems OK.
Message 5 of 6
GCIIEvan
in reply to: phanaem

Thanks, that does seem to be a good workaround. I suppose this is just one of those things.
Message 6 of 6
stevor
in reply to: GCIIEvan

The cause may be that the Spline that you see on the screen may not exactly be the one you imagine. Unlike Lines and Arcs, the geometry of the Spline NURBs used by Autocad is not so easy to check. And Spline geometry rules differ between other CAD, and especially CNC, systems If the extension option works, it will likely provide the accuracy that you expect.
S

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

Post to forums  

Autodesk Design & Make Report

”Boost