Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I found this script form @ronjonp on https://www.cadtutor.net/forum/topic/65111-framing-ruller/?do=findComment&comment=536574 - the basic ruller scipt on top (function foo).
How to modify this script to draw the same but not in X axis left to right but in Y axis top to bottom ? At the best automatically by choosing the direction during picking the distance.
Original code from author:
(defun c:foo (/ a d i n p p2)
;; RJP - 04-10-2018
;; Creates a simple ruler
(cond ((and (not (initget 7))
(setq i (getint "\nEnter spacing: "))
(setq p (getpoint "\nPick start point: "))
(setq d (getdist p "\nPick Distance: "))
)
(setq n 0)
(while (<= n d)
(entmakex (list '(0 . "LINE")
(cons 10 (setq p2 (polar p 0. n)))
(cons 11
(list (car p2)
(- (cadr p2)
(cond ((setq a (= 0 (rem n 5))) 2.)
(1.)
)
)
)
)
(cons 62
(if a
1
2
)
)
)
)
(if a
(entmakex (list '(0 . "TEXT")
'(100 . "AcDbEntity")
'(67 . 0)
'(8 . "0")
'(62 . 4)
'(100 . "AcDbText")
(cons 10 (list (car p2) (- (cadr p2) 3.)))
'(40 . 2.0)
(cons 1 (itoa (fix (/ (distance p p2) i))))
'(41 . 1.0)
'(7 . "Standard")
'(71 . 0)
'(72 . 1)
(cons 11 (list (car p2) (- (cadr p2) 3.)))
'(100 . "AcDbText")
'(73 . 3)
)
)
)
(setq n (+ n i))
)
)
)
(princ)
)
Solved! Go to Solution.