구름마크 리습질문 다시 올립니다.
컨텐츠 정보
- 319 조회
- 3 댓글
- 0 추천
- 0 비추천
- 목록
본문
다시 올립니다
구름마크 리습인데 고수님이 올려주신 리습을 다운받았는데
호지름을 안넣고 바로 호지름에 지정호13 이란 숫자가 입력되어서 바로 점과점을 직으면 구름마크 나오게끔 수정해주시면 안될까요 고수님 부탁드릴께요
(defun c:cdt (/ *error* plw pt1 pt2 p1 p2 xdist ydist spcsx spcsy ent1 ent2 nxt info bulge data c_o c_l)
(defun *error* (msg)
(setvar "osmode" c_o)
(setvar "clayer" c_l)
)
(print ">> Cloud Draw Tool…")
(setq c_o (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq c_l (getvar "clayer"))
(setq ly (tblsearch "layer" "Revision"))
(if (= ly nil) (command "layer" "n" "36″ ""))
(setvar "clayer" "36″)
(if (= ds nil)
(setq ds 10);;(setq ds 10)
)
(setq plw (* 2 ds)
oer *error*
bm (getvar "blipmode"))
(print)
(setq str (strcat "호 지름<" (rtos ds 2) "> : "));;;;;;;;;;;<————————이부분에서 (setq str 13)으로 수정을 했는데 수치만 들어가고 엔터를 쳐야 되는데 바로 다음으로 갈수 있게 만들어 주시면 안될까요
(setq buf (getint str));;;;;;;; (setq buf (getint str))
(if (= buf NIL)
(setq buf ds)
(setq ds buf)
)
(defun *error* (s) ;start error routine
(setvar "blipmode" bm) ;reset blipmode
(princ (strcat "Exit…" s)) ;type error message
(if oer (setq *error* oer))
(princ))
(print)
(SETQ PT1 (GETPOINT "영역의 좌측 하단점: ")) (terpri)
(setq pt2 (getcorner pt1 "영역의 우측 상단점: "))
(setvar "blipmode" 0)
(setq p1 (car pt1) p2 (car pt2) ;find x distances
xdist (- p2 p1))
(setq p1 (cadr pt1) p2 (cadr pt2) ;find y distances
ydist (- p2 p1))
;******TO ADJUST SPACING OF ARCS CHANGE THE NUMBER 2 IN THE NEXT TWO LINES*****
(setq spcsx (/ (abs xdist) (/ (* ds (getvar "dimscale")) 2)) ;X spacing
spcsy (/ (abs ydist) (/ (* ds (getvar "dimscale")) 2))) ;Y spacing
(if (= spcsx (fix spcsx)) (setq spcsx (fix spcsx)) (setq spcsx (+ 1 (fix spcsx))))
(if (= spcsx 1) (setq spcsx 2)) ;min of 2 spaces
(if (= spcsy (fix spcsy)) (setq spcsy (fix spcsy)) (setq spcsy (+ 1 (fix spcsy))))
(if (= spcsy 1) (setq spcsy 2)) ;min of 2 spaces
(setq xdist (/ xdist spcsx) ydist (/ ydist spcsy)) ;set distances
(setq p1 pt1) ;set polyline start point
(command "PLINE" p1 "W" "1″ "") ;start polyline command
(repeat spcsx ;draw bottom line segments
(setq p1 (polar p1 0.0 (abs xdist)))
(command p1))
(repeat spcsy ;draw right line segments
(setq p1 (polar p1 (/ pi 2) (abs ydist)))
(command p1))
(repeat spcsx ;draw top line segments
(setq p1 (polar p1 pi (abs xdist)))
(command p1))
(repeat (- spcsy 1) ;draw left line segments
(setq p1 (polar p1 (* pi 1.5) (abs ydist)))
(command p1))
(command "C") ;Close polyline
(setq ent1 (entlast) ;get entity
ent2 (entget ent1) ;get entity info
;******TO ADJUST THE ARC SIZE ADJUST THE 0.5 BELOW*******
bulge (list (cons 42 0.5)) ;build cloud arcs 0.5
nxt (cdr (assoc -1 ent2)) ;set for lookup
nxt (entnext nxt) ;get next one
plw (list (cons 41 plw))) ;build cloud width
(if (= nxt nil)
(progn
(setq ent2 (subst (cons 42 0.5) (assoc 42 ent2) ent2))
(entmod ent2) ;modify entity
)
(while nxt ;start loop
(setq info (entget nxt) ;get exist. info
info (append info bulge) ;set bulge
info (append info plw) ;set width
) ;end of setq
(entmod info) ;modify entity
(setq nxt (entnext nxt)) ;get next segment
) ;end of while
)
(entupd ent1) ;update entity
(setvar "blipmode" bm) ;reset blipmode
(setvar "cmdecho" 1) ;turn command echo on
(setvar "osmode" c_o)
(setvar "clayer" c_l) .
(gc) (princ) ;print blank line
) ;End program
관련자료
상큼메론90님의 댓글
호지름 13 고정
(defun c:cdt (/ *error* plw pt1 pt2 p1 p2 xdist ydist spcsx spcsy ent1 ent2 nxt info bulge data c_o c_l) (defun *error* (msg) (setvar "osmode" c_o) (setvar "clayer" c_l) ) (print ">> Cloud Draw Tool…") (setq c_o (getvar "osmode")) (setvar "cmdecho" 0) (setvar "osmode" 0) (setq c_l (getvar "clayer")) (setq ly (tblsearch "layer" "Revision")) (if (= ly nil) (command "layer" "n" "36″ "")) (setvar "clayer" "36″) (if (= ds nil) (setq ds 13);;(setq ds 10) ) (setq plw (* 2 ds) oer *error* bm (getvar "blipmode")) (print) ;(setq str (strcat "호 지름<" (rtos ds 2) "> : ")) (setq str 13) ;(setq buf (getint str)) ;(if (= buf NIL) ; (setq buf ds) ; (setq ds buf) ???? (defun *error* (s) ;start error routine (setvar "blipmode" bm) ;reset blipmode (princ (strcat "Exit…" s)) ;type error message (if oer (setq *error* oer)) (princ)) (print) (SETQ PT1 (GETPOINT "영역의 좌측 하단점: ")) (terpri) (setq pt2 (getcorner pt1 "영역의 우측 상단점: ")) (setvar "blipmode" 0) (setq p1 (car pt1) p2 (car pt2) ;find x distances xdist (- p2 p1)) (setq p1 (cadr pt1) p2 (cadr pt2) ;find y distances ydist (- p2 p1)) ;******TO ADJUST SPACING OF ARCS CHANGE THE NUMBER 2 IN THE NEXT TWO LINES***** (setq spcsx (/ (abs xdist) (/ (* ds (getvar "dimscale")) 2)) ;X spacing spcsy (/ (abs ydist) (/ (* ds (getvar "dimscale")) 2))) ;Y spacing (if (= spcsx (fix spcsx)) (setq spcsx (fix spcsx)) (setq spcsx (+ 1 (fix spcsx)))) (if (= spcsx 1) (setq spcsx 2)) ;min of 2 spaces (if (= spcsy (fix spcsy)) (setq spcsy (fix spcsy)) (setq spcsy (+ 1 (fix spcsy)))) (if (= spcsy 1) (setq spcsy 2)) ;min of 2 spaces
(setq xdist (/ xdist spcsx) ydist (/ ydist spcsy)) ;set distances (setq p1 pt1) ;set polyline start point (command "PLINE" p1 "W" "1″ "") ;start polyline command (repeat spcsx ;draw bottom line segments (setq p1 (polar p1 0.0 (abs xdist))) (command p1)) (repeat spcsy ;draw right line segments (setq p1 (polar p1 (/ pi 2) (abs ydist))) (command p1)) (repeat spcsx ;draw top line segments (setq p1 (polar p1 pi (abs xdist))) (command p1)) (repeat (- spcsy 1) ;draw left line segments (setq p1 (polar p1 (* pi 1.5) (abs ydist))) (command p1)) (command "C") ;Close polyline
(setq ent1 (entlast) ;get entity ent2 (entget ent1) ;get entity info ;******TO ADJUST THE ARC SIZE ADJUST THE 0.5 BELOW******* bulge (list (cons 42 0.5)) ;build cloud arcs 0.5 nxt (cdr (assoc -1 ent2)) ;set for lookup nxt (entnext nxt) ;get next one plw (list (cons 41 plw))) ;build cloud width
(if (= nxt nil) (progn (setq ent2 (subst (cons 42 0.5) (assoc 42 ent2) ent2)) (entmod ent2) ;modify entity ) (while nxt ;start loop (setq info (entget nxt) ;get exist. info info (append info bulge) ;set bulge info (append info plw) ;set width ) ;end of setq (entmod info) ;modify entity (setq nxt (entnext nxt)) ;get next segment ) ;end of while ) (entupd ent1) ;update entity (setvar "blipmode" bm) ;reset blipmode (setvar "cmdecho" 1) ;turn command echo on (setvar "osmode" c_o) (setvar "clayer" c_l) (gc) (princ) ;print blank line ) ;End program
rnsdlsajfl님의 댓글
- rnsdlsajfl 이름으로 검색
- 작성일
상큼메론님 감사합니다 저부분에 넣으면 되군요 잘쓰겠습니다 하나만 더부탁드려도 될까요?
무한반복 카피리습인데 오스넵이 처음엔 중심점에 잡히다가 풀리네요 계속 중심점으로 반복카피하고 싶은데요 물론 명령어가 끈나면 원래 오스넵 잡힌거로 돌아가게끔 (setvar "osmode" cqw) 문구를 넣었는데요… (defun c:A2 ( / cqw) (setq cqw (getvar "osmode")) (setvar "osmode" 4) (setq ss (ssget )) (princ "nt시작포인트 :") (command "copy" ss "" "m" pause) (setvar "osmode" cqw) (princ) )
이 리습도 마찬가지로 처음엔 무한선을 되엇다가 몇번찍으면 1번이엇던게 현제 레이어로 바뀌고요 고수님 원인이 먼지좀 봐주세요 저는 계속 1번으로 갔다가 명령어 끈나면 되엇으면 하는데…..
(defun c:A2 ( / cqw) (setq cqw (getvar "CLAYER")) (setvar "CLAYER" "1″) (command "XLINE" "V" pause) (setvar "CLAYER" cqw) (princ) )