리스을 처음 스터디 중입니다.
아래와 같은 리습을 이용해서 좌표검토용 시트를 구현하려고합니다.
아래의 리습 명령어의 자세한 설명을 알수 있을까요?
Ent 여기서부터 막히네요
처음 작업하는사람이라 깜깜이 입니다.
감사합니다.
(defun c:TT (/ cPl cFmn fVar pLst cAns *error*)
(defun Extract_3DPoly_Vertexes(Ent / cLst oLst)
(if(= ‘ENAME(type Ent))
(setq Ent(vlax-ename->vla-object Ent))
); end if
(if(= “AcDb3dPolyline”(vla-get-ObjectName Ent))
(progn
(setq cLst(vlax-safearray->list
(vlax-variant-value
(vla-get-Coordinates Ent))))
(while cLst
(setq oLst(cons
(list
(car cLst)
(cadr cLst)
(nth 2 cLst))
oLst)
); end setq
(repeat 3(setq cLst(cdr cLst)))
); end while
(reverse oLst)
); end progn
); end if
); end of Extract_3DPoly_Vertexes
(if(and
(setq cPl(entsel “nSelect 3D-Polyline > “))
(= “POLYLINE”(cdr(assoc 0(entget(setq cPl(car cPl))))))
); and
(progn
(setq fVar(open(setq cFmn(strcase(strcat(getvar “DWGPREFIX”)
(vl-filename-base(getvar “DWGNAME”)) “.csv”))) “a”)
pLst(Extract_3DPoly_Vertexes cPl)
); end setq
(write-line “X,Y,Z” fVar)
(foreach pt pLst
(write-line
(strcat(rtos(car pt))”,”(rtos(cadr pt))”,”(rtos(last pt)))
fVar)
); end foreach
(close fVar)
(alert(strcat “nCSV File location: ” cFmn))
); end progn
(princ “<!> It isn’t 3D-Polyline <!> “)
); end if
(princ)
); end of c:3csv
(princ “nType 3csv to run”)
(defun c:TT (/ cPl cFmn fVar pLst cAns *error*)
(defun Extract_3DPoly_Vertexes(Ent / cLst oLst)
(if(= ‘ENAME(type Ent))
(setq Ent(vlax-ename->vla-object Ent))
); end if
(if(= “AcDb3dPolyline”(vla-get-ObjectName Ent))
(progn
(setq cLst(vlax-safearray->list
(vlax-variant-value
(vla-get-Coordinates Ent))))
(while cLst
(setq oLst(cons
(list
(car cLst)
(cadr cLst)
(nth 2 cLst))
oLst)
); end setq
(repeat 3(setq cLst(cdr cLst)))
); end while
(reverse oLst)
); end progn
); end if
); end of Extract_3DPoly_Vertexes
(if(and
(setq cPl(entsel “nSelect 3D-Polyline > “))
(= “POLYLINE”(cdr(assoc 0(entget(setq cPl(car cPl))))))
); and
(progn
(setq fVar(open(setq cFmn(strcase(strcat(getvar “DWGPREFIX”)
(vl-filename-base(getvar “DWGNAME”)) “.csv”))) “a”)
pLst(Extract_3DPoly_Vertexes cPl)
); end setq
(write-line “X,Y,Z” fVar)
(foreach pt pLst
(write-line
(strcat(rtos(car pt))”,”(rtos(cadr pt))”,”(rtos(last pt)))
fVar)
); end foreach
(close fVar)
(alert(strcat “nCSV File location: ” cFmn))
); end progn
(princ “<!> It isn’t 3D-Polyline <!> “)
); end if
(princ)
); end of c:3csv
(princ “nType 3csv to run”)
정말 감사드립니다.
많은 도움이 됬습니다. ^^