Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Need help to fic the code, Just insert "D_ARW" Block in each Mline midle.
(defun c:IN_ARW (/ mline-list mline start-point end-point ARW-block mid-point i)
(setq mline-list (ssget '((0 . "MLINE"))))
(setq ARW-block "D_ARW") ; Block name
(if mline-list
(progn
(setq i 0)
(repeat (sslength mline-list)
(setq mline (ssname mline-list i))
(setq start-point (vlax-curve-getStartPoint mline))
(setq end-point (vlax-curve-getEndPoint mline))
(setq mid-point (list (/ (+ (car start-point) (car end-point)) 2.0)
(/ (+ (cadr start-point) (cadr end-point)) 2.0)))
(command "_.INSERT" ARW-block mid-point 1 1 0) ; Insert block with correct rotation
(setq i (1+ i)) ; Increment index
)
)
)
(princ)
)
Solved! Go to Solution.