Message 1 of 6
Autocad dies suddenly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all.
The following program converts a circle into a specified block.
When I changed the sub function from A to B, AutoCAD started to die suddenly.
It seems to stop at (command "-insert" block "" "" ""), but the contents of the block are the same and I don't know the cause.
Can you tell me what the cause is?
Help me.
A
(defun _replace
(pt1 pt2
/ dai block obj ent newss nn i pnt
)
(setq dai (getreal "\n target diameter is : "))
(setq block (getstring "\nreplacement block name is : "))
(setq dai (/ dai 2))
(setq newss (ssget "_C" pt1 pt2 (list (cons 0 "circle") (cons 40 dai))))
(setq nn (sslength newss))
(setq i 0)
(repeat nn
(setq obj (ssname newss i))
(setq ent (entget obj))
(setq pnt (cdr (assoc 10 ent)))
(entdel (ssname newss i))
(command "-insert" block pnt "" "" "")
(setq i (+ i 1))
)
(princ)
)
B
(defun _replace
(pt1 pt2 dai block
/ obj ent newss nn i pnt
)
(setq dai (/ dai 2))
(setq newss (ssget "_C" pt1 pt2 (list (cons 0 "circle") (cons 40 dai))))
(setq nn (sslength newss))
(setq i 0)
(repeat nn
(setq obj (ssname newss i))
(setq ent (entget obj))
(setq pnt (cdr (assoc 10 ent)))
(entdel (ssname newss i))
(command "-insert" block pnt "" "" "")
(setq i (+ i 1))
)
(princ)
)
Saitoib