1) you have .txt file with manholes positions and dimensions
row in data is
x,y,width,height, thickness
let say
100,100,150,150,25
500,500,150,150,25
300,300,150,150,25
1000,1000,150,150,25
1200,1200,150,150,25
2) Here is a list that creates manholes
(defun c:kilama (/ *error* string_to_list f file1 redak x y w h d dx dy p1 p2)
(defun *error* ()
(setvar 'cmdecho 1)
(close file1)
)
(defun string_to_list ( str del / pos )
(if (setq pos (vl-string-search del str))
(cons (substr str 1 pos) (string_to_list (substr str (+ pos 1 (strlen del))) del))
(list str)
)
)
(setvar 'cmdecho 0)
(setq f (getfiled "Open File" (getvar "dwgprefix") "txt" 2))
(setq file1 (open f "r"))
(while (setq redak (read-line file1))
(mapcar 'set '(x y w h d) (mapcar 'atof (string_to_list redak ",")))
(setq dx (* 0.5 w) dy (* 0.5 h))
(setq p1 (mapcar '- (list x y) (list dx dy)))
(setq p2 (mapcar '+ (list x y) (list dx dy)))
(command "_.rectangle" p1 p2)
(command "_.offset" d (entlast) (list x y) "")
)
(close file1)
(command "_.zoom" "e")
(setvar 'cmdecho 1)
(princ)
)
As a result you receive

Miljenko Hatlak

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.