Reputation: 4654
i try to describe this problem well with my humble English skills :
i have closed blocks on my dwg file, these blocks are consist of many Polylines which are joined together but they are not uni-body (integrated), all i want is a lisp to draw a polygon over this block and create a uni-body block. is there any way around ?
thnx
Upvotes: 1
Views: 1615
Reputation: 15289
Assuming that:
then try the following:
(defun convert_block_to_polyline (block / old_entlast new_entlast curr polylines_set)
(setq old_entlast (entlast))
(command "explode" block)
(setq new_entlast (entlast))
(setq
curr (entnext old_entlast)
polylines_set (ssadd)
)
(while (entnext curr)
(ssadd curr polylines_set)
(setq curr (entnext curr))
)
(command "join" (entlast) polylines_set "")
(princ)
)
This function assumes:
Upvotes: 3