ObjectDBX

Discussion in 'AutoCAD' started by Big 'D', Apr 8, 2005.

  1. Big 'D'

    Big 'D' Guest

    Earlier this week I had some excellent help form some folks (Clarence, Tom, Walt) on moving objects from Paper Space to Model Space. This ended (after working it over thoroughly) with a routine that could be used in ObjectDBX. Right now I am running it in AutoCAD as a lisp (but the command line to invoke is L o n g).
    I do not know anything about ObjectDBX. I didn't want to keep adding to the previous post because it is a different subject
    (Clarence, Tom, Walt - that is your free invitation to join). I want to add to this routine but don't want to jeopardize it's terrific functionality as it is now.
    Care to advise?
    D
     
    Big 'D', Apr 8, 2005
    #1
  2. Big 'D'

    T.Willey Guest

    For some reason I though I helped in that other subject, oh well life goes one. ahahahah.. Just playing.

    There have been many post about ObjectDBX. Your best bet maybe to search the web site, then post about what you don't understand so that you can get the help you need.

    Tim
     
    T.Willey, Apr 8, 2005
    #2
  3. Big 'D'

    Big 'D' Guest

    Tim,
    I am so sorry - It was a fat finger slip. You are a SUPERSTAR in my books! Your help was invaluable.

    D
     
    Big 'D', Apr 8, 2005
    #3
  4. Big 'D'

    T.Willey Guest

    T.Willey, Apr 8, 2005
    #4
  5. Big 'D'

    Big 'D' Guest

    Tim,
    Wow, I read the suggested post. That is a lot of information. You know what part I had trouble understanding completely? ALL OF IT. I did follow some of it. But everything I have read seems to depict understanding of the basic part where everything starts. I understand the definition and description of ObjectDBX. Does it start from inside AutoCAD? I put the text in an lsp file, loaded it in AutoCAD and started it by typing
    (MoveTitleBlock (vla-get-ActiveDocument (vlax-get-Acad-Object)))
    This is not what I am used to seeing as a command to invoke lisp. Can we start there and see what I can catch as it tries to fly over my head? I am a self taught auto-lisper and sometimes my heart wants it to be easy but my head says otherwise. Thanks for the support.
    D
     
    Big 'D', Apr 8, 2005
    #5
  6. Big 'D'

    T.Willey Guest

    Ok on the machine that has 2004 you can use these.
    First make a variable with all the drawings you want to update (only a few to start with, and use test drawings also). Like this (setq DwgList '("H:/eMatrix/PICS/OMEGA-01.dwg" "H:/eMatrix/PICS/OMEGA-02.dwg" "H:/eMatrix/PICS/OMEGA-03.dwg" "H:/eMatrix/PICS/OMEGA-04.dwg"))

    then do this in a lisp

    (foreach Dwg DwgList
    (setq Rslt (tmw:OpenDBX Dwg))
    (if (vl-string-search "Copyof-" (cadr Rslt))
    (tmw:CloseDBX Rslt T)
    (progn
    (MoveTitleBlock (car Rslt))
    (vla-SaveAs (car Rslt) (cadr Rslt))
    (tmw:CloseDBX Rslt T)
    )
    )
    )

    Here are my ObjectDBX functions.
    (defun tmw:OpenDBX (FileName / NewFileName TestIf dbxDoc)

    (if FileName
    (progn
    (if (setq TestIf (open FileName "a"))
    (close TestIf)
    (progn
    (setq NewFileName (strcat (vl-filename-directory FileName) "\\" (strcat "CopyOf-" (vl-filename-base FileName) ".dwg")))
    (if (not (vl-file-copy FileName NewFileName))
    (progn
    (setq NewFileName (strcat "c:\\" (strcat "CopyOf-" (vl-filename-base FileName) ".dwg")))
    (vl-file-copy FileName NewFileName)
    )
    )
    (setq FileName NewFileName)
    )
    )
    (setq dbxDoc (vla-GetInterfaceObject (vlax-get-ACAD-Object) "ObjectDBX.AxDbDocument.16"))
    (vla-Open dbxDoc FileName)
    (list dbxDoc FileName)
    )
    )
    )

    ;-------------------------------------------------------------------

    (defun tmw:CloseDBX (Results EraseFile / FileName)

    (setq FileName (cadr Results))
    (vl-Catch-All-Apply '(lambda () (vla-Close (car Resutls))))
    (vlax-Release-Object (car Results))
    (if
    (and
    (= EraseFile T)
    (vl-string-search "CopyOf-" (vl-filename-base FileName))
    )
    (vl-file-delete FileName)
    )
    )

    This should get you started.
    Tim
     
    T.Willey, Apr 8, 2005
    #6
  7. Big 'D'

    Big 'D' Guest

    Tim,
    I am off chasing rabbits right now. I read over your instruction and at least understand what I read. Hopefully I can get back on it soon. And once again,
    Thank you!
    D
     
    Big 'D', Apr 8, 2005
    #7
  8. Big 'D'

    T.Willey Guest

    Cool. Post back when you have a chance, and I will add this to my watched topics so I will notice it quickly, and hopefully be able to respond quickly.

    Good luck. The only way I learned was to drive in, and ask for help when I couldn't find it in the help docs or in this ng.
    Tim
     
    T.Willey, Apr 8, 2005
    #8
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.