Author Topic: plz point me in the right direction VB, LISP??  (Read 12066 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: plz point me in the right direction VB, LISP??
« Reply #30 on: September 16, 2005, 10:18:10 AM »
http://management.cadalyst.com/cadman/article/articleDetail.jsp?id=101853

I found it amusing that of the 4 things that article says can't be done from Visual LISP, 3 can be done with a little imagination.

(1) Integration with external databases. Hello, I've been talking to databases from Visual LISP for years. Initially I had done it by compiling a dll that wrapped ADO calls, but recently I decided to translate portions of this book to Visual LISP calls. Surprise, not that much code and execution is surprisingly fast.

(2) Open and close multiple drawings. A little clever self referencing lisp that writes scripts on the fly should be able to do this.

(3) Work with multiple files/share data. Hello, ObjectDBX and Item (1) above.

:P
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

deegeecees

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #31 on: September 16, 2005, 12:46:11 PM »
I hear ya MP. This is a fragment from an old ADOLisp file I had laying around, and this is 5 years old:

Code: [Select]
  (setq ConnectString "Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\ADOLISP_test.mdb")
  (prompt (strcat "\n\nConnecting to the database using \n\""
          ConnectString
                  "\""
          )
  )

Open and close multiple drawings!!!??? Are you kidding me!!  :realmad:
Code: [Select]
;batch_anything.lsp
;Created for G.E.I.S. by P.R. Donnelly
;Date: Sept of 2002
;Description: Batch Process
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;start prog

(DEFUN C:batch_anything ()

;;;;;;;;;;;;;;;;;;;;;;;;;Select directory to be processed

(setq dfil (getfiled "Select A File In The Directory You Want To Batch Process" "p:/" "dwg" 0))
(setq wutdir (vl-filename-directory dfil))
(setq wutfiles (vl-directory-files wutdir "*.dwg"))

(setq scrfile (open "c:\\scrfile.scr" "w"))
(close scrfile)
(setq scrfile (open "c:\\scrfile.scr" "a"))

(foreach n wutfiles
(setq n2 (strcat "\""wutdir "\\" n "\""))
(setq n2 (vl-string-translate "\\" "\\" n2))
(setq scrline (strcat "open" " " n2 " " "(load\"batch_core\")" " " "batch_insert" " " "qsave" " " "close"));;;;;;;COMMANDS FOR BATCH GO HERE
(write-line scrline scrfile)
(princ)
)

(close scrfile)
(command "script" "c:\\scrfile")

(princ "\n***Batch complete.***")
(princ)


);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DEFUN