검색을 통해서 찾았던, 안쪽으로 여러 객체 offset 가능한 리습입니다.
그런데 어떤 상황에서는 잘 되는데, 어떤 상황에서는 바깥쪽으로 offset이 됩니다.
어떤 경우에 오류가 발생하는지도 잘 모르겠고, 코드를 봐도 어느 부분이 문제인지 전혀 모르겠습니다.
고수님들의 조언 부탁드립니다ㅠㅠ
(defun c:pof( / plines ; selection set of polylines
ext ; extrnal point
dist ; distance to offset
poly ; a polyline from plines
plist ; the list of poly
del ; polyline to delete
int ; internal point
i)
(command “undo” “begin”)
(princ “select polylines”)
(setq plines (ssget)
i 0
ext (getvar “limmax”)
dist (getdist “distance”))
(repeat (sslength plines)
(setq poly (ssname plines i))
(setq plist (entget poly))
(command “offset” dist poly ext “”)
(setq del (entlast)
int (polar
(cdr (assoc 10 (entget del)))
(angle
(cdr (assoc 10 (entget del)))
(cdr (assoc 10 plist)))
(* 2 (distance (cdr (assoc 10 plist))
(cdr (assoc 10 (entget del)))))))
(command “offset” dist poly int “”)
(entdel del)
(setq i (1+ i)))
(command “undo” “end”)
(if (= “Y” (strcase (getstring “ndelete initial polylines? (Y/N)”)))
(command “erase” plines “”))
)
공유
모두 답변 주셔서 감사합니다. 아쉽게도 해결은 못하고 구글링으로 새로운 offset 리습 찾아서 사용중입니다:)
스냅문제도 있을지 모르니 osmode 를 0으로 해보시는건?
ext 포인트 위치와 폴리라인의 생김새와의 상관 관계및 폴리라인의 방향성 문제 참 다양하게 문제 있는 구문입니다