externally editing a drawing

Discussion in 'AutoCAD' started by Marcel Janmaat, Jan 31, 2005.

  1. I want to edit a drawing in the background.

    What I want to do is, simply open the drawing (a block), edit an attribute
    with the tag STH, change it's value and prompt and then close it again.

    Is the best way to do this through a script or has anyone got any other
    suggestion on the best approach to accomplish this?


    M
     
    Marcel Janmaat, Jan 31, 2005
    #1
  2. Marcel Janmaat

    James Buzbee Guest

    I want to edit a drawing in the background.

    This sounds like a job for ObjectDBX.

    All done via ActiveX on the DbxDocument. There have been numerous threads
    and code posted. Search the AutoCAD Customization NG.

    jb
     
    James Buzbee, Jan 31, 2005
    #2
  3. Marcel Janmaat

    T.Willey Guest

    From my experience editing an attribute within a drawing that is opened with ObjectDBX doesn't give you the results you want. Basically it move the attribute.

    Tim
     
    T.Willey, Jan 31, 2005
    #3
  4. Marcel Janmaat

    Rudy Tovar Guest

    As an example you'd have to do something similar to this, and then access
    the attributes and edit them...This was written for Autocad 2005...

    (defun dbx-dwg (dwgname / dbxDoc)

    (if (and (not (vl-registry-read
    "HKEY_CLASSES_ROOT\\ObjectDBX.AxDbDocument.16\\CLSID"
    )
    )
    (findfile "axdb16.dll")
    )
    (startapp "regsvr32.exe"
    (strcat "/s \"" (findfile "axdb16.dll") "\"")
    )
    )

    (setq dbxDoc
    (vla-GetInterfaceObject
    (vlax-get-acad-object)
    "ObjectDBX.AxDbDocument.16"
    ; MUST reference autocad DBX version
    )
    )


    (vla-open dbxDoc DwgName)

    (dbx-data-base dbxdoc)

    (vl-catch-all-apply
    '(lambda () (vla-close DBXDOC ':VLAX-TRUE 'ITEM))
    )

    (VL-CATCH-ALL-APPLY
    'vlax-release-object
    (list dbxDoc dwgname dbx-data-base)

    )
    (vlax-release-object dbxDoc)
    (setq dbxDoc nil)

    )

    (defun dbx-data-base ( dbxdoc / for-item name)

    (vlax-for for-item (vla-get-modelspace dbxDoc)
    (progn ; start of object cycle

    (setq name (vla-get-objectname for-item))
    (if
    (= name "AcDbBlockReference")
    (progn
    ;Conditions
    (if (= (vla-get-name for-item) "01DetailTitle")
    (progn
    (setq detail_scale_reference (vla-get-YScaleFactor for-item))
    )
    )

    )
    );if block


    )
    )
    (princ)
    )
     
    Rudy Tovar, Jan 31, 2005
    #4
  5. Thanx for this. I'll look in to it lateron...

    M

     
    Marcel Janmaat, Feb 1, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.