Results 1 to 5 of 5

Thread: HOw to add attribute and modified by objectdbx?

  1. #1
    Member
    Join Date
    2007-01
    Posts
    24
    Login to Give a bone
    0

    Default HOw to add attribute and modified by objectdbx?

    this is my third question..

    i wanna modify attribute tagstring and add up in specific block by object dbx

    this is my whole 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
    i couln't find what was problem in this lsp source..

    could anybody advise to me about this lisp source?

    then i will really happy

    thanks autocad users !!
    Last edited by Opie; 2009-09-15 at 01:50 PM. Reason: [code] tags added

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: HOw to add attribute and modified by objectdbx?

    Your problem is this line:
    ( vlax-put-property upc_att 'TextString ( cdr ( assoc "DI_DRWNO" "TD_DWGCODE" )))

    Try using this at the command prompt and you will see the problem.
    Command: ( cdr ( assoc "DI_DRWNO" "TD_DWGCODE" ))
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: HOw to add attribute and modified by objectdbx?

    Isn't there a justification problem when using ObjectDBX to "push" attribute values?

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: HOw to add attribute and modified by objectdbx?

    Quote Originally Posted by dgorsman View Post
    Isn't there a justification problem when using ObjectDBX to "push" attribute values?
    Yes, if the justification is other than Left.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    Member
    Join Date
    2007-01
    Posts
    24
    Login to Give a bone
    0

    Default Re: HOw to add attribute and modified by objectdbx?

    thankx for your advised

Similar Threads

  1. VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool
    By katrinanjim in forum VBA/COM Interop
    Replies: 53
    Last Post: 2017-06-11, 09:56 PM
  2. Changing attribute text strings using ObjectDBX
    By brett.hyland372887 in forum RealDWG
    Replies: 1
    Last Post: 2013-06-16, 06:44 PM
  3. Replies: 0
    Last Post: 2012-11-14, 03:10 PM
  4. Replies: 1
    Last Post: 2009-05-06, 06:40 PM
  5. C# and ObjectDBX?
    By KevinBarnett in forum Dot Net API
    Replies: 1
    Last Post: 2006-09-19, 06:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •