sivapathasunderam Posted February 7, 2016 Share Posted February 7, 2016 Hello; I need a Lisp that will measure blocks along polyline by specify length (The length should always calculate from 0, beginning of polyline) Eample: Drawing unit is in Meter I have a Road center line of 10Km (10000m), if i enter length 3300m block should place at 3300m if i enter length 5600m block should place at 5600m Many thanks Siva Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2016 Share Posted February 7, 2016 Hi, What is the name of the Block? What about the rotation of the block? Is it attributed block? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 7, 2016 Share Posted February 7, 2016 Try the Dynamic option of Alan's Copy Along Curve program. Or you can use my old Space Along Curve program. Quote Link to comment Share on other sites More sharing options...
sivapathasunderam Posted February 7, 2016 Author Share Posted February 7, 2016 (edited) Hi; Block name is CATCH_PIT with one attribute as shown Rotation is Perpendicular to alignment of the Road, as i attached dwg cannot able to attach file size is more than 1MB thanks Siva Edited February 7, 2016 by sivapathasunderam added clear image Quote Link to comment Share on other sites More sharing options...
sivapathasunderam Posted February 7, 2016 Author Share Posted February 7, 2016 This exercise is to place CATCH_PIT BLOCKS with specific chainages along polyline (Road Length is 36.6Km) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2016 Share Posted February 7, 2016 What about the value of the attribute ? Will it be asked to the user to enter or is it a static value ? Quote Link to comment Share on other sites More sharing options...
sivapathasunderam Posted February 7, 2016 Author Share Posted February 7, 2016 Yes, it will ask the user to enter (it varies) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2016 Share Posted February 7, 2016 (edited) Try this draft and let me know. (defun c:Test (/ blk s e l d v) ;; Tharwat 07.Feb.2016 ;; (setq blk "CATCH_PIT") ;; Block name (if (and (tblsearch "BLOCK" blk) (princ "\nSelect LWpolyline :") (setq s (ssget "_+.:S:E" '((0 . "LWPOLYLINE")))) (setq l (vlax-curve-getdistatpoint (setq e (ssname s 0)) (vlax-curve-getendpoint e)))) (while (and (setq d (getdist (strcat "\nSpecify distance less than " (rtos l 2 2) " > :") ) ) (< d l) (/= "" (setq v (getstring t "\nSpecify Attribute Value :"))) ) (entmake (list '(0 . "INSERT") (cons 10 (vlax-curve-getpointatdist e d)) (cons 50 (+ (* pi 0.5)(angle '(0. 0. 0.) (vlax-curve-getfirstderiv e (vlax-curve-getparamatpoint e (vlax-curve-getpointatdist e d)))))) (cons 2 blk) ) ) (if (> d l) (alert "\nLong distance entered !") ) ) ) (princ) )(vl-load-com) Edited February 7, 2016 by Tharwat Quote Link to comment Share on other sites More sharing options...
sivapathasunderam Posted February 7, 2016 Author Share Posted February 7, 2016 Great Job, but the only thing is it's place the block parallel to Alignment as shown Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2016 Share Posted February 7, 2016 Codes updated above , try again. Quote Link to comment Share on other sites More sharing options...
sivapathasunderam Posted February 7, 2016 Author Share Posted February 7, 2016 Codes updated above , try again. Excellent work Tharwat! I really appreciate it. I search the google for more than 5 hours couldn't get any thing Thanks for the help! Siva Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 7, 2016 Share Posted February 7, 2016 Excellent work Tharwat!I really appreciate it. I search the google for more than 5 hours couldn't get any thing Thanks for the help! Siva Nice. Happy to hear that - you are most welcome Siva. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.