TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Amsterdammed on November 03, 2005, 07:48:54 AM

Title: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Amsterdammed on November 03, 2005, 07:48:54 AM
Hello,

I just ran the “Layer filter delete.lsp” from the post down here on this page and saw a dwg with the size of 2 MB limited to 400KB. So that is great.

 Now I wonder:

We gave a lot of dwgs on our server, a lot of 3rd party dwgs with 20000+ layer filters, too.

Is there a way to approach the dwgs and run the “layer filter delete” WITHOUT opening the dwgs? (I know how to do it in a script with opening one for one).

Thanks in advance,

Bernd
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Keith™ on November 03, 2005, 08:15:01 AM
you might be able to do it using ObjectDBX by importing the type libraries into vlisp
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 09:10:59 AM
Here is one I put together for AutoCad 2000:

Code: [Select]
(defun LayerFiltersDelete (doc)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers doc)
)
"ACAD_LAYERFILTERS"
       )
     )
  )
)

(defun w:*error* (msg)
  (princ "\nError: ")
  (princ msg)
  (princ)
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (princ)
)

(defun get_dwgs (path)
  (mapcar '(lambda (x)
     (mapcar '(lambda (y)
(strcat x "\\" y)
      )
     (vl-directory-files x "*.dwg" 1)
     )
   )
  path
  )
)

(defun c:lfd_odbx (/ kword folder file files dbxdoc of *error*)
  (initget 1 "Yes No")
  (setq kword (getkword
  "Do you want to search in subdirectories? [Yes/No]: "
)
files (cond ((eq kword "Yes")
       (apply 'append
      (get_dwgs (*list_folders* (acet-ui-pickdir)))
       )
      )
      ((eq kword "No")
       (setq file (getfiled "Select a File" "" "dwg" (+ 4 128)))
       (car (get_dwgs (list (vl-filename-directory file))))
      )
)
*error* w:*error*
  )
  (if (not (*DBX-Register*))
    (*error* "Could not load the ObjectDBX Interface.")
  )
  (setq dbxdoc (vla-GetInterfaceObject
(vlax-get-acad-object)
"ObjectDBX.AxDbDocument"
       )
  )
  (foreach f files
    (setq of (vl-catch-all-apply
       '(lambda ()
  (vlax-invoke-method dbxdoc 'open f)
)
     )
    )
    (if (vl-catch-all-error-p of)
      (*error* (vl-catch-all-error-message of))
      (progn
(LayerFiltersDelete dbxdoc)
(princ
  (strcat "\nDeleting Layer Filters in " f)
)
(vla-saveas dbxdoc f)
      )
    )
  )
  (vlax-release-object dbxdoc)
  (gc)
  (princ)
)

Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Amsterdammed on November 03, 2005, 09:18:27 AM
Will,
I miss something in your code:

Quote
; error: no function definition: *LIST_FOLDERS*
Bernd
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 09:30:37 AM
oops...sorry  :oops:

Your actually missing some more too.
Just use this instead of what I posted earlier:

Quote
;;;
;;;Utilities to register ObjectDBX with AutoCAD 2K
;;;
(defun *DLLRegister* (dll)
  (startapp "regsvr32.exe" (strcat "/s \"" dll "\""))
)

(defun *ProgID->ClassID* (ProgID)
  (vl-registry-read
    (strcat "HKEY_CLASSES_ROOT\\" progid "\\CLSID")
  )
)

(defun *DBX-Register* (/ classname server)
  (setq classname "ObjectDBX.AxDbDocument")
  (cond
    ((*ProgID->ClassID* classname))
    ((and
       (setq server (findfile "AxDb15.dll"))
       (*DLLRegister* server)
       (*ProgID->ClassID* classname)
     )
     (*ProgID->ClassID* classname)
    )
    ((not (setq server (findfile "AxDb15.dll")))
     (alert
       "Error: Cannot locate ObjectDBX Type Library (AxDb15.dll)..."
     )
    )
    (T
     (*DLLRegister* classname)
     (or
       (*ProgID->ClassID* classname)
       (alert
    "Error: Failed to register ObjectDBX ActiveX services..."
       )
     )
    )
  )
)
;;;
;;;
;;;
(defun *layout_list* (/ lst)
  (vlax-map-collection
    (vla-get-layouts
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x) (setq lst (cons x lst)))
  )
  (cdr
    (*sort* lst 'vla-get-taborder)
  )
)


(defun *sort* (lst func)
  (vl-sort lst
      '(lambda (e1 e2)
         (< ((eval func) e1) ((eval func) e2))
       )
  )
)

(defun LayerFiltersDelete (doc)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
    (vla-GetExtensionDictionary
      (vla-Get-Layers doc)
    )
    "ACAD_LAYERFILTERS"
       )
     )
  )
)

(defun w:*error* (msg)
  (princ "\nError: ")
  (princ msg)
  (princ)
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (princ)
)

(defun get_dwgs   (path)
  (mapcar '(lambda (x)
        (mapcar '(lambda (y)
         (strcat x "\\" y)
            )
           (vl-directory-files x "*.dwg" 1)
        )
      )
     path
  )
)

(defun c:lfd_odbx (/ kword folder file files dbxdoc of *error*)
  (initget 1 "Yes No")
  (setq   kword   (getkword
        "Do you want to search in subdirectories? [Yes/No]: "
      )
   files   (cond ((eq kword "Yes")
             (apply 'append
               (get_dwgs (*list_folders* (acet-ui-pickdir)))
             )
            )
            ((eq kword "No")
             (setq file (getfiled "Select a File" "" "dwg" (+ 4 128)))
             (car (get_dwgs (list (vl-filename-directory file))))
            )
      )
   *error*   w:*error*
  )
  (if (not (*DBX-Register*))
    (*error* "Could not load the ObjectDBX Interface.")
  )
  (setq   dbxdoc (vla-GetInterfaceObject
       (vlax-get-acad-object)
       "ObjectDBX.AxDbDocument"
          )
  )
  (foreach f files
    (setq of (vl-catch-all-apply
          '(lambda   ()
        (vlax-invoke-method dbxdoc 'open f)
      )
        )
    )
    (if   (vl-catch-all-error-p of)
      (*error* (vl-catch-all-error-message of))
      (progn
   (LayerFiltersDelete dbxdoc)
   (princ
     (strcat "\nDeleting Layer Filters in " f)
   )
   (vla-saveas dbxdoc f)
      )
    )
  )
  (vlax-release-object dbxdoc)
  (gc)
  (princ)
)

Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Amsterdammed on November 03, 2005, 09:51:13 AM
Will,

indeed there were more missing.

But........... Sitll missing the *LIST_FOLDERS* function

Bernd
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: ronjonp on November 03, 2005, 10:04:31 AM
I get the same error as well Will.

When in doubt....search the forum :).

http://www.theswamp.org/forum/index.php?topic=3564.msg43226#msg43226

Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: MP on November 03, 2005, 10:09:45 AM
Quote from: Amsterdammed
Hello,

I just ran the “Layer filter delete.lsp” from the post down here on this page and saw a dwg with the size of 2 MB limited to 400KB. So that is great.

Now I wonder:

We gave a lot of dwgs on our server, a lot of 3rd party dwgs with 20000+ layer filters, too.

Is there a way to approach the dwgs and run the “layer filter delete” WITHOUT opening the dwgs? (I know how to do it in a script with opening one for one).

Thanks in advance,

Bernd

Please be careful Amsterdammed, I've seen attempts at automatic fixes become automatic fubars. Backup your data, do exhaustive tests on representative sample data, have a recovery plan. You don't want to be the latest entry in this (http://www.theswamp.org/forum/index.php?topic=7494.msg94012#msg94012) thread.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: ronjonp on November 03, 2005, 10:28:48 AM
Will,

So what the next step in troubleshooting when I get the error:

Error: Failed to register ObjectDBX ActiveX services...
Error: Could not load the ObjectDBX Interface.
Error: Automation Error. Problem in loading application

I changed the AxDb15.dll to AxDb16.dll since I'm on 2005.

So I did some searching in the registry and found that "ObjectDBX.AxDbDocument" is "ObjectDBX.AxDbDocument.16". Changed that but still getting the error:

Error: Automation Error. Problem in loading application


Thanks,

Ron
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Amsterdammed on November 03, 2005, 10:30:12 AM
Right Micheael,

It still always scares me when a  lot of things are  done automatically. But we have everything on tape  as back up, and I sure will not let a lisp run all over the server to change  all the dwgs. But I will definitely use it for cleaning up 3rd party dwgs we use as xrefs.
But thanks for the reminder Michael, indeed I don’t want to join the “wound liking dogs” club.

Bernd
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 11:01:36 AM
Sorry for the confusion guys:

This should work for 2000 and 2002:
Code: [Select]
;;;
;;;Utilities to register ObjectDBX with AutoCAD 2K
;;;
(defun *DLLRegister* (dll)
  (startapp "regsvr32.exe" (strcat "/s \"" dll "\""))
)

(defun *ProgID->ClassID* (ProgID)
  (vl-registry-read
    (strcat "HKEY_CLASSES_ROOT\\" progid "\\CLSID")
  )
)

(defun *DBX-Register* (/ classname server)
  (setq classname "ObjectDBX.AxDbDocument")
  (cond
    ((*ProgID->ClassID* classname))
    ((and
       (setq server (findfile "AxDb15.dll"))
       (*DLLRegister* server)
       (*ProgID->ClassID* classname)
     )
     (*ProgID->ClassID* classname)
    )
    ((not (setq server (findfile "AxDb15.dll")))
     (alert
       "Error: Cannot locate ObjectDBX Type Library (AxDb15.dll)..."
     )
    )
    (T
     (*DLLRegister* classname)
     (or
       (*ProgID->ClassID* classname)
       (alert
"Error: Failed to register ObjectDBX ActiveX services..."
       )
     )
    )
  )
)
;;;
;;;
;;;
(defun *layout_list* (/ lst)
  (vlax-map-collection
    (vla-get-layouts
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x) (setq lst (cons x lst)))
  )
  (cdr
    (*sort* lst 'vla-get-taborder)
  )
)


(defun *sort* (lst func)
  (vl-sort lst
   '(lambda (e1 e2)
      (< ((eval func) e1) ((eval func) e2))
    )
  )
)

(defun *list_folders* (path)
  (defun get_folders (folder / f)
    (mapcar '(lambda (x)
       (cons (setq f (strcat folder "\\" x))
     (apply 'append (get_folders f))
       )
     )
    (cddr (vl-directory-files folder nil -1))
    )
  )
  (cons path (apply 'append (get_folders path)))
)

(defun LayerFiltersDelete (doc)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers doc)
)
"AcLyDictionary"
       )
     )
  )
)

(defun w:*error* (msg)
  (princ "\nError: ")
  (princ msg)
  (princ)
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (princ)
)

(defun get_dwgs (path)
  (mapcar '(lambda (x)
     (mapcar '(lambda (y)
(strcat x "\\" y)
      )
     (vl-directory-files x "*.dwg" 1)
     )
   )
  path
  )
)

(defun c:lfd_odbx (/ kword folder file files dbxdoc of *error* lst)
  (initget 1 "Yes No")
  (setq kword (getkword
  "Do you want to search in subdirectories? [Yes/No]: "
)
files (cond ((eq kword "Yes")
       (apply 'append
      (get_dwgs (*list_folders* (acet-ui-pickdir)))
       )
      )
      ((eq kword "No")
       (setq file (getfiled "Select a File" "" "dwg" (+ 4 128)))
       (car (get_dwgs (list (vl-filename-directory file))))
      )
)
*error* w:*error*
  )
  (if (not (*DBX-Register*))
    (*error* "Could not load the ObjectDBX Interface.")
  )
  (setq dbxdoc (vla-GetInterfaceObject
(vlax-get-acad-object)
"ObjectDBX.AxDbDocument"
       )
  )
  (foreach f files
    (setq of (vl-catch-all-apply
       '(lambda ()
  (vlax-invoke-method dbxdoc 'open f)
)
     )
    )
    (if (vl-catch-all-error-p of)
      (setq lst (cons (vl-catch-all-error-message of) lst))
      (progn
(LayerFiltersDelete dbxdoc)
(princ
  (strcat "\nDeleting Layer Filters in " f)
)
(vla-saveas dbxdoc f)
      )
    )
  )
  (vlax-release-object dbxdoc)
  (gc)
  (if lst (princ lst))
  (princ)
)

This should work for 2004:
Code: [Select]
(defun *layout_list* (/ lst)
  (vlax-map-collection
    (vla-get-layouts
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x) (setq lst (cons x lst)))
  )
  (cdr
    (*sort* lst 'vla-get-taborder)
  )
)
;;;
(defun *sort* (lst func)
  (vl-sort lst
   '(lambda (e1 e2)
      (< ((eval func) e1) ((eval func) e2))
    )
  )
)
;;;
(defun *list_folders* (path)
  (defun get_folders (folder / f)
    (mapcar '(lambda (x)
       (cons (setq f (strcat folder "\\" x))
     (apply 'append (get_folders f))
       )
     )
    (cddr (vl-directory-files folder nil -1))
    )
  )
  (cons path (apply 'append (get_folders path)))
)
;;;
(defun LayerFiltersDelete (doc)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers doc)
)
"AcLyDictionary"
       )
     )
  )
)
;;;
(defun w:*error* (msg)
  (princ "\nError: ")
  (princ msg)
  (princ)
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (princ)
)
;;;
(defun get_dwgs (path)
  (mapcar '(lambda (x)
     (mapcar '(lambda (y)
(strcat x "\\" y)
      )
     (vl-directory-files x "*.dwg" 1)
     )
   )
  path
  )
)
;;;
(defun c:lfd_odbx (/ kword folder file files dbxdoc of *error* lst)
  (initget 1 "Yes No")
  (setq kword (getkword
  "Do you want to search in subdirectories? [Yes/No]: "
)
files (cond ((eq kword "Yes")
       (apply 'append
      (get_dwgs (*list_folders* (acet-ui-pickdir)))
       )
      )
      ((eq kword "No")
       (setq file (getfiled "Select a File" "" "dwg" (+ 4 128)))
       (car (get_dwgs (list (vl-filename-directory file))))
      )
)
*error* w:*error*
  )
  (setq dbxdoc (vla-GetInterfaceObject
(vlax-get-acad-object)
"ObjectDBX.AxDbDocument.15"
       )
  )
  (foreach f files
    (setq of (vl-catch-all-apply
       '(lambda ()
  (vlax-invoke-method dbxdoc 'open f)
)
     )
    )
    (if (vl-catch-all-error-p of)
      (setq lst (cons (vl-catch-all-error-message of) lst))
      (progn
(LayerFiltersDelete dbxdoc)
(princ
  (strcat "\nDeleting Layer Filters in " f)
)
(vla-saveas dbxdoc f)
      )
    )
  )
  (vlax-release-object dbxdoc)
  (gc)
  (if lst (princ lst))
  (princ)
)


This should work 2005 and 2006:
Code: [Select]
(defun *layout_list* (/ lst)
  (vlax-map-collection
    (vla-get-layouts
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x) (setq lst (cons x lst)))
  )
  (cdr
    (*sort* lst 'vla-get-taborder)
  )
)
;;;
(defun *sort* (lst func)
  (vl-sort lst
   '(lambda (e1 e2)
      (< ((eval func) e1) ((eval func) e2))
    )
  )
)
;;;
(defun *list_folders* (path)
  (defun get_folders (folder / f)
    (mapcar '(lambda (x)
       (cons (setq f (strcat folder "\\" x))
     (apply 'append (get_folders f))
       )
     )
    (cddr (vl-directory-files folder nil -1))
    )
  )
  (cons path (apply 'append (get_folders path)))
)
;;;
(defun LayerFiltersDelete (doc)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers doc)
)
"ACAD_LAYERFILTERS"
       )
     )
  )
)
;;;
(defun w:*error* (msg)
  (princ "\nError: ")
  (princ msg)
  (princ)
  (if (and dbxdoc (not (vlax-object-released-p dbxdoc)))
    (vlax-release-object dbxdoc)
  )
  (gc)
  (princ)
)
;;;
(defun get_dwgs (path)
  (mapcar '(lambda (x)
     (mapcar '(lambda (y)
(strcat x "\\" y)
      )
     (vl-directory-files x "*.dwg" 1)
     )
   )
  path
  )
)
;;;
(defun c:lfd_odbx (/ kword folder file files dbxdoc of *error* lst)
  (initget 1 "Yes No")
  (setq kword (getkword
  "Do you want to search in subdirectories? [Yes/No]: "
)
files (cond ((eq kword "Yes")
       (apply 'append
      (get_dwgs (*list_folders* (acet-ui-pickdir)))
       )
      )
      ((eq kword "No")
       (setq file (getfiled "Select a File" "" "dwg" (+ 4 128)))
       (car (get_dwgs (list (vl-filename-directory file))))
      )
)
*error* w:*error*
  )
  (setq dbxdoc (vla-GetInterfaceObject
(vlax-get-acad-object)
"ObjectDBX.AxDbDocument.16"
       )
  )
  (foreach f files
    (setq of (vl-catch-all-apply
       '(lambda ()
  (vlax-invoke-method dbxdoc 'open f)
)
     )
    )
    (if (vl-catch-all-error-p of)
      (setq lst (cons (vl-catch-all-error-message of) lst))
      (progn
(LayerFiltersDelete dbxdoc)
(princ
  (strcat "\nDeleting Layer Filters in " f)
)
(vla-saveas dbxdoc f)
      )
    )
  )
  (vlax-release-object dbxdoc)
  (gc)
  (if lst (princ lst))
  (princ)
)


edit:  Added functionality to print a list of drawings that were not changed.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: ronjonp on November 03, 2005, 12:33:39 PM
Thanks will :).

One more question....how would one go about modifying this so it ignores readonly files rather than crashing the proggie?

Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Jeff_M on November 03, 2005, 12:42:37 PM
Note that the use of ObjectDBX and saving the drawing loses the Drawing preview image. If you wish to maintain the image, see  THIS  (http://www.theswamp.org/forum/index.php?topic=7335.msg91135#msg91135) post that uses a helper app. If you need help implementing it just let me know.

ronjonp, you will need to wrap the Saveas line into a vl-catch-all-apply function. I would suggest placing the name of any file that cannot be saved into a text file so you know which ones were not modified.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 01:10:51 PM
Thanks will :).

One more question....how would one go about modifying this so it ignores readonly files rather than crashing the proggie?



I'll have to check into that.  I came across that before but I don't remember what I did to resolve it.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 01:12:52 PM
...ronjonp, you will need to wrap the Saveas line into a vl-catch-all-apply function. I would suggest placing the name of any file that cannot be saved into a text file so you know which ones were not modified.

I think it is already done that way Jeff.

Code: [Select]
(setq of (vl-catch-all-apply
       '(lambda ()
             (vlax-invoke-method dbxdoc 'open f)
        )
     )
)
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 01:43:39 PM
Edited the code above for new functionality to print a list of drawings that were not changed.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 03, 2005, 02:02:52 PM
The other option would be to just ignore the ones you can't open:

Code: [Select]
(if (not (vl-catch-all-error-p of))
      (progn
(LayerFiltersDelete dbxdoc)
(princ
  (strcat "\nDeleting Layer Filters in " f)
)
(vla-saveas dbxdoc f)
      )
    )
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Jeff_M on November 03, 2005, 03:20:51 PM
I think it is already done that way Jeff.
So it is.....I didn't look at the code prior to posting, oops. However, you CAN open a read-only file without error.....it's when you save it that the error occurs. Hmmm, actually I don't get an error, just an alert box saying it can't be saved..... Should probably find a function to check if the file is RO and skip it if it is.....
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: T.Willey on November 03, 2005, 03:27:54 PM
Here is one I use.

Code: [Select]
(defun CheckOpen (FileName / test)
; Return T if not open.

(if (findfile FileName)
 (if (setq test (open FileName "a"))
  (progn
   (close test)
   T
  )
 )
)
)

Tim
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: ronjonp on November 03, 2005, 04:21:30 PM
Why won't this purge work in the dbx?

Code: [Select]
(defun LayerFiltersDelete (doc)
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers doc)
)
"ACAD_LAYERFILTERS"
       )
     )
  )
  (vl-Catch-All-Apply
    '(lambda ()
       (vla-Remove
(vla-GetExtensionDictionary
   (vla-Get-Layers doc)
)
"AcLyDictionary"
       )
     )
  )

       (vla-purgeall
(vla-get-activedocument
   (vlax-get-acad-object)
)
       )

)
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: T.Willey on November 03, 2005, 04:51:33 PM
Quote
(vla-purgeall
   (vla-get-activedocument
      (vlax-get-acad-object)
   )
       )

This is trying to purge the active document (drawing) instead of the one you open with ObjectDBX.  Maybe try
(vla-PurgeAll Doc)  since you use Doc as the argument.  It might not work with ObjectDBX, but I'm not sure.

Tim
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: MP on November 03, 2005, 04:57:13 PM
It might not work with ObjectDBX, but I'm not sure.

Tim

That's correct iirc, you have to analyze all the collections yourself and perform intelligent trapped deletes.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: ronjonp on November 03, 2005, 04:59:37 PM
Just found on another forum:

Quote
Michael Puckett
Guest





   
[Post] Posted: Wed Jan 12, 2005 12:25 am    Post subject: Re: ObjectDbx : Xref Detach kaput    Reply with quote
Note to self: PurgeAll not available in ObjectDBX.


Hey! I know that guy! At least in cyberspace :).
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: MP on November 03, 2005, 05:01:19 PM
That guy is a flake.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: T.Willey on November 03, 2005, 05:05:01 PM
Code: [Select]
(defun DeleteFromCollection (Collection / )
; Delete all objects in a collection that can be deleted.

(vlax-for i Collection
 (vl-catch-all-apply 'vla-Delete i)
)
)

I just posted this in another forum.

Tim
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: T.Willey on November 03, 2005, 05:09:03 PM
That's correct iirc, you have to analyze all the collections yourself and perform intelligent trapped deletes.

Thanks for the clarification.

Tim
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Bob Wahr on November 03, 2005, 05:20:52 PM
Code: [Select]
(defun DeleteFromCollection (Collection / )
; Delete all objects in a collection that can be deleted.

(vlax-for i Collection
 (vl-catch-all-apply 'vla-Delete i)
)
)

I just posted this in another forum.

Tim
I just posted this here. ;P
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Jeff_M on November 03, 2005, 05:56:01 PM
I just posted this in another forum.
Tim
OK, I give up........how did you come up with the user name of CiphDRMRS from Tim Willey???? (or vice versa...)
Oh, and welcome to the swamp!
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Bob Wahr on November 03, 2005, 06:01:11 PM
Until I new it was Tim, I was thinking that he was the wife of a Dr. who specialized in treating syphilis, and who wasn't too sharp with spelling.  Now I'm going to guess that he is a member of an organization called Ciphilitic Drummers (as most drummers are and few can spell)
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: T.Willey on November 03, 2005, 06:12:03 PM
Okay.  My friends and I were starting a Hip-Hop group  :-), and my nick was Cipher Ciph for short, and the group name was D.R.E.A.M.E.R.S.  Back in the day you couldn't have a long screen name with aol, so I had to shorten it.  I haven't changed it ever since, but I think I might have to soon because my parents (whose account it is) is getting cable, and leaving aol.

Can you guess how old I am?  :lmao:

Tim
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Jeff_M on November 03, 2005, 06:19:40 PM
'm not sure which answer makes more sense...the contrived one by Dr.Wahr or the real one. :)

One guess..... 25
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: T.Willey on November 03, 2005, 06:22:29 PM
I liked his explaination also. :lol:

Close. 28 now.

Tim
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: deegeecees on November 04, 2005, 05:27:28 PM
Not to get off topic but, is it possible to plot with ObjectDBX?
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Kerry on November 04, 2005, 05:42:47 PM
No.



But I would really like to be proven wrong ...
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Jeff_M on November 04, 2005, 06:05:49 PM
Quote from: Kerry Brown
But I would really like to be proven wrong ...
I know I can't do it for the subject at hand.... :|
but give me a while and  I'm sure I will find something you did wrong .....  :laugh:
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Bob Wahr on November 04, 2005, 06:11:01 PM
don't remember for sure but it seems like open drawing alliance or whatever they call themselves these days had something that could at least in theory allow plotting without opening Autocad.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: whdjr on November 05, 2005, 01:48:44 PM
Not to get off topic but, is it possible to plot with ObjectDBX?
No.



But I would really like to be proven wrong ...

I had a conversation from Autodesk once and they said you can only print using ObjectDBX if you sign up as an ObjectDBX Developer with Autodesk.
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: MP on November 05, 2005, 02:22:11 PM
I had a conversation from Autodesk once and they said you can only print using ObjectDBX if you sign up as an ObjectDBX Developer with Autodesk.

Ch'Ching, $5000 entry fee (now called Real Dawg (http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=770257)).
Title: Re: run a lisp in dwgs WITHOUT opening the dwgs?
Post by: Dinosaur on November 05, 2005, 03:13:33 PM
I have downloaded the Open Design Alliance (formerly OpenDWG.org) toolkit for r2005.  I haven't done anything with it but if someone can point me in a direction I will try to find out if it has anything to help.