You can not
or you will not ?
Hello Kerry,
I do not informed well, I should not interrupt the work of a function to create a temporary entity and then delete it, as it may happen thousands of times. I already have a polyline selected in beginning the work of a function.
You don't need to interrupt anything or do anything manually.
Have you tried the code or looked at how it works ??
The line is drawn and erased when finished by the program ... I doubt you will actually ever see it.
The code is just proof of concept to demonstrate the functionality. I doesn't matter if you select the points and line or if they are provided programmatically ; the methodology still works.
For production code I'd produce a standalone function that takes the pline object and the 2 points as parameters and returns either the intersection point of nil, as applicable. This way it can be called from either an interactive or programmatic situation.
Regards,