Author Topic: xml , html import lisp in autocad ?  (Read 3792 times)

0 Members and 1 Guest are viewing this topic.

dussla

  • Bull Frog
  • Posts: 291
xml , html import lisp in autocad ?
« on: March 10, 2008, 04:46:06 AM »
IS there  good xml , html import lisp  in autocad ?

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: xml , html import lisp in autocad ?
« Reply #1 on: March 10, 2008, 08:05:15 AM »
What exactly are you trying to import, and what should the result look like?

FengK

  • Guest
Re: xml , html import lisp in autocad ?
« Reply #2 on: March 10, 2008, 12:49:41 PM »
you mean to process?
(vlax-create-object "htmlfile")

http://msdn2.microsoft.com/en-us/library/bb508515(VS.85).aspx



dussla

  • Bull Frog
  • Posts: 291
Re: xml , html import lisp in autocad ?
« Reply #3 on: March 10, 2008, 09:12:04 PM »
if you see  http://www.pave-a-way.co.uk/portfolio.htm , you can see tables
i would like to  put  html table  in cad
i used  dotsoft "word2cad"  , but that didn't import  word table
i would like to import word table and html file
only i need import lisp about  word(doc) , html , image in www   rapidly

can you understand my letter ?~
i will wait good answer
« Last Edit: March 13, 2008, 12:16:36 AM by dussla »

dussla

  • Bull Frog
  • Posts: 291
Re: xml , html import lisp in autocad ?
« Reply #4 on: March 13, 2008, 12:18:44 AM »
friends , is there good routine about xml import ?

dussla

  • Bull Frog
  • Posts: 291
Re: xml , html import lisp in autocad ?
« Reply #5 on: March 13, 2008, 09:10:34 PM »
i found this lisp in www
but that didn;t import word table object  ,  isn's that impossible ?


;;;Open a word document
(defun Open-Word (xfile dmode / appsession)
  (princ "\nOuverture du document Word...")
  (cond
    ( (setq fn (findfile xfile))
      (cond
        ((setq appsession (vlax-get-or-create-object
"Word.Application"))
          (vlax-invoke-method
            (vlax-get-property appsession 'Documents)
            'Open fn
          )
          (if (= (strcase dmode) "SHOW")
            (vla-put-visible appsession 1)
            (vla-put-visible appsession 0)
          )
        )
      )
    )
    ( T (alert (strcat "\nCannot find the source file: " xfile)) )
  )
  (princ)
)


;;;Close the document
(defun Word-Quit ()
  (cond
    ( (not (vlax-object-released-p appsession))
      (vlax-invoke-method appsession 'QUIT)
      (vlax-release-object appsession)
    )
  )
  (princ)
)


;;;import in AutoCAD
(defun c:Word2Acad ( / )
  (if (not (member "doslib16.arx" (arx)))
    (arxload "doslib16")
  )
  (setq fichier (dos_getfiled "Choose a Word document" (getvar
"dwgprefix")
                              "Documents Word (*.doc)|*.doc|Rich text
format (*.rtf)|*.rtf|Fichier Ascii (*.txt)|*.txt|Tous les
fichiers(*.*)|*.*||"))
  (if fichier
    (progn
      (if (open-word fichier "hide")
        (progn
          (setq Selection (vlax-get-property appsession 'selection))
          (setq TheDocument (vlax-get-property Selection 'document))
          (setq Sentences (vlax-get-property TheDocument 'sentences))
          (setq string nil)
          (vlax-for for-item
                    Sentences
            (if (= (vlax-get-property for-item 'Underline) 1)
              (setq string (append string (list (strcat "{\\L"
(vlax-get-property for-item 'text)))))
              (setq string (append string (list (vlax-get-property
for-item 'text))))
            )
          )
          (setq cont 0)
          (repeat (length string1)
            (setq string (subst (substr (nth cont string) 1 (- (strlen
(nth cont string)) 1)) (nth cont string) string))
            (if (dos_strreversefind (nth cont string) "\r")
              (setq string (subst (dos_strreplace (nth cont string)
"\r" "\\P") (nth cont string) string))
            )
            (if (= (substr (nth cont string) 1 1) "{")
              (setq string (subst (strcat (nth cont string) "}") (nth cont
string) string))
            )
            (setq cont (+ 1 cont))
          )
          (setq largeur (* 70 (getvar "textsize")))
          (setq p1 (getpoint "\nUpper left corner of text:"))
          (command "_-mtext" p1 "_w" largeur )
          (setq cont 0)
          (repeat (length string)
            (command (nth cont string))
            (setq cont (+ 1 cont))
          )
          (command "")
          (Word-Quit)
        )
      )
    )
  )
  (princ)
)




It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8704
  • AKA Daniel
Re: xml , html import lisp in autocad ?
« Reply #6 on: March 13, 2008, 09:31:54 PM »
« Last Edit: March 13, 2008, 09:37:02 PM by Daniel »

dussla

  • Bull Frog
  • Posts: 291
Re: xml , html import lisp in autocad ?
« Reply #7 on: March 13, 2008, 09:39:03 PM »
ok thank you good relpy ~~