ymg3 Posted March 29 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
shahAbdul Posted April 2 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
devitg Posted April 2 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
BIGAL Posted April 4 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
shahAbdul Posted April 5 Posted April 5 @BIGAL i use 2.5 for spacing but not function..notice error display ' autocard applacation: filer error' Quote
zwonko Posted April 5 Author Posted April 5 @shahAbdul Without file with the problem We can't help You Quote
devitg Posted April 5 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
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.