this is my third question..
i wanna modify attribute tagstring and add up in specific block by object dbx
this is my whole source..
i couln't find what was problem in this lsp source..Code:(defun c:mmd ( / path dwglist dwg_length cnt td_dwgcode fullpath dwg_obj ps DBXstr DBXDoc ) ;(setq acadver (atoi (getvar "acadver"))) ; (startapp "regsvr32.exe" (strcat "/s \"" "Axdb" (itoa acadver) ".dll" "\"")) ;(setq dbxdoc (vla-GetInterfaceObject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa acadver)))) ;캐드열지않고 실행 지정 (setq DBXstr (if (< (atof (getvar "ACADVER")) 16.0) "ObjectDBX.AxDbDocument" (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar "AcadVer")))) ) DBXDoc (vla-getinterfaceobject (vlax-get-acad-object) DBXstr) ) (setq path (acet-ui-pickdir)) (setq dwglist (vl-directory-files path "*.dwg"));도면을 선택한다!! (setq dwg_length (length dwglist));선택한 도면의 파일수를구한다. (setq cnt 0) ;반복문 셀렉션셋에서 순서대로 파일명입력하기.. ;반복문시작.. (repeat dwg_length (setq dwg_obj (nth cnt dwglist)) ;list에서 첫번째도면파일 얻기 (setq td_dwgcode (substr dwg_obj 1 12));첫번째 도면파일에서 파일명얻기.. (setq fullpath (strcat path "\\" dwg_obj)) ;저장경로설정 (setq dwgname fullpath);dwg이름을 경로로 설정 (vla-open DBXDoc dwgname) ;dbx로 도면 열기 실행 (vlax-for ps (vla-get-modelspace DBXDOC) ( setq upc_blkobj (vlax-ename->vla-object ps)) ( setq upc_attlist (vlax-invoke upc_blkobj 'GetAttributes)) ( foreach upc_att upc_attlist ( if ( = (vla-get-tagstring upc_att ) ( strcase "DI_DRWNO" ) );속성태그값값 입력 ( vlax-put-property upc_att 'TextString ( cdr ( assoc "DI_DRWNO" "TD_DWGCODE" ))) );i );end foreach ( vlax-release-object dbxdoc ) );end vlax-for (setq cnt (+ cnt 1)) );end repeat );end defun
could anybody advise to me about this lisp source?
then i will really happy
thanks autocad users !!