Thankyou All who reponse to my post.
Lee's code might be what im after, need to incorporate see how it works.
As i mentioned on my post, the code only for demonstration purpose.
Its sometime quite hard to explain a small portion of code out of the overall codes.
I have this working function to break a MLINE and insert a block, but user require to pick (osnap nearest) the centre line of the MLINE.What i want is flexibility if user pick the outer edge of MLINE but still be able to insert the block at the centre line location.
The only user input is pick (osnap nearest) on the MLINE, (this will be the insertion point) the rest are all done by codes.
- convert Mline to Pline
- Break the Pline
- convert the 2 pline back to mline
- insert the block at pick location (only works if pick centre line of mline)
Its sometime quite difficult to pick the centre line of mline if this Mline consisted of even number of parallel lines (ie 4, 6, 8 paralell lines)
Thats why i need the point on the centre line if user pick the outer edge of Mline.
I thinks Lees code will work to transform the pick point onto the Polyline (after converting ML - PL)
Cheers