ymg3 Posted March 29 Share Posted March 29 (edited) Here's my take. ;; cone_batter by ymg ; ;; ; ;; Note that ssb remains global and is the selection set of batters, ; ;; At a selection prompt enter !ssb ; ;; ; ;; Prog requires function midpoint. ; ;; ; (defun c:cone_batter (/ ent1 ent2 p1 p2 cum1 cum2 len1 len2 n_bat n i) (setq ent1 (car (entsel "\n Select a TOP polyline: ")) ent2 (car (entsel "\n Select a BOTTOM polyline: ")) n_bat (getint "\n How many batter tics: ") n (+ 1 n_bat) ) (setq len1 (/ (vlax-curve-getdistatparam ent1 (vlax-curve-getendparam ent1)) n) len2 (/ (vlax-curve-getdistatparam ent2 (vlax-curve-getendparam ent2)) n) cum1 0.0 cum2 0.0 i 0 ssb (ssadd) ) (repeat (+ n 1) (setq p1 (vlax-curve-getPointAtDist ent1 cum1) p2 (vlax-curve-getPointAtDist ent2 cum2) ) (if (zerop (rem i 2)) (entmake (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2))) (entmake (list (cons 0 "LINE") (cons 10 p1) (cons 11 (midpoint p1 p2)))) ) (ssadd (entlast) ssb) (setq cum1 (+ cum1 len1) cum2 (+ cum2 len2) i (+ i 1) ) ) ) ;; Function midpoint by ymg ; ;; Returns the midpoint between 2 points. ; (defun midpoint (a b) (polar a (angle a b) (* (distance a b) 0.5))) ymg cone_batter.lsp Edited March 30 by ymg3 Commented the code and re-uploaded 2 Quote Link to comment Share on other sites More sharing options...
zwonko Posted March 29 Author Share Posted March 29 Thanks @ymg3, also working good! Quote Link to comment Share on other sites More sharing options...
shahAbdul Posted April 2 Share Posted April 2 @BIGALi have use batterticks.lsp but not function... in my autocad type tbl.. and notice " enter spacing of tick" i enter and notice display "select the batter top" i klik line on object and notice "select the opposite site"...when enter only one long line appear Quote Link to comment Share on other sites More sharing options...
devitg Posted April 2 Share Posted April 2 6 hours ago, shahAbdul said: @BIGALi have use batterticks.lsp but not function... in my autocad type tbl.. and notice " enter spacing of tick" i enter and notice display "select the batter top" i klik line on object and notice "select the opposite site"...when enter only one long line appear @shahAbdul Please upload both DWG and Lsp you use. Quote Link to comment Share on other sites More sharing options...
shahAbdul Posted April 4 Share Posted April 4 @devitg i use lsp bigal opload... battertick Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 4 Share Posted April 4 The batter tick spacing is how far along the top object the tick is placed so if an arc is say 10 long a spacing of 2.5 should work. Quote Link to comment Share on other sites More sharing options...
shahAbdul Posted April 5 Share Posted April 5 @BIGAL i use 2.5 for spacing but not function..notice error display ' autocard applacation: filer error' Quote Link to comment Share on other sites More sharing options...
zwonko Posted April 5 Author Share Posted April 5 @shahAbdul Without file with the problem We can't help You Quote Link to comment Share on other sites More sharing options...
devitg Posted April 5 Share Posted April 5 12 hours ago, shahAbdul said: i use 2.5 for spacing but not function..notice error display ' autocard applacation: filer error' @shahAbdul you need this block at your dwg 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.