OUT DOC

OUT DOC

rolisonfelipe
Collaborator Collaborator
898 Views
10 Replies
Message 1 of 11

OUT DOC

rolisonfelipe
Collaborator
Collaborator

;;;;;; DCL FOR SELECT MORE OF ONE DOC  E EXPORT IN DESKTOP....

 

DOC : dialog
{label = "OFFICE";
:row{
: column{
: toggle {label = "DOC X";key = "DOC1"; }
: toggle {label = "DOC Y";key = "DOC1"; }
: toggle {label = "DOC Z";key = "DOC1"; }}}
: button {label = " EXIT " ;key ="BT-SAIR" ;fixed_width=true;width=0;alignment=centered;}
: button {label = "GO DOC" ;key ="BT-GODOC" ;fixed_width=true;width=0;alignment=centered;is_default=true;}
}

 

 

;;;;;LSP

(DEFUN C:DOC ()
(vl-load-com)

(defun Dxf (Index)
(cdr (assoc Index (entget (ssname TxtSet Count))))
);end Dxf
(setq TILE (getvar "DECRITION"));
(setq FILE (strcat "/N,/E," (getvar "DWGPREFIX")))
(setq FLAGOK1 T)
(setq XFIM1 0)
(while FLAGOK1
(new_dialog "DOC" ARQ_DCL)
(action_tile "DOCZ" "(done_dialog 3)")
(action_tile "DOCY" "(done_dialog 2)")
(action_tile "DOCX" "(done_dialog 1)")
(action_tile "BT-SAIR" "(done_dialog 0)")
(action_tile "BT-GODOC" "(done_dialog 100)")
(setq XFIM1 (start_dialog))
(if (= XFIM1 0) (setq FLAGOK1 nil))
(if (= XFIM1 1) ( (cond ((setq TxtSet (ssget '((0 . "*TEXT"))));----SELECTION TEXT START
(cond
((setq File (getfiled "Select Word document" (strcat (vl-filename-base (getvar "dwgname")) ".doc") "doc" 1))
(vl-load-com)
(prompt "\nExport text to Word. Please wait...")
(princ)
(if (not (setq Word (vlax-get-object "Word.Application")));;;is already open ?
(setq Word (vlax-get-or-create-object "Word.Application"));;; no open
(setq Flag#1 T)
);end if
(cond
(Word
(if (not Flag#1) (vla-put-visible Word :vlax-false));;; hide window application
(if (findfile File)
(setq Flag#2 (member (strcase (findfile File)) (GetOpenDocs (vlax-get-property Word 'Documents)))
NewDoc (vlax-invoke-method (vlax-get-property Word 'Documents) 'Open File))
(setq NewDoc (vlax-invoke-method (vla-get-documents Word) 'add))
);end if
(setq Paragraphs (vlax-get-property NewDoc 'Paragraphs) Count 0)
(repeat (sslength TxtSet)
(setq String (vla-get-TextString (vlax-ename->vla-object (ssname TxtSet Count))))
(setq Range (vlax-get-property (vlax-get-property Paragraphs 'last) 'Range))
(if (not (setq FontName (cdar (cdadr (assoc -3 (entget (tblobjname "STYLE" (Dxf 7)) '("ACAD")))))))
(setq FontName (vl-filename-base (cdr (assoc 3 (tblsearch "STYLE" (Dxf 7))))))
);end if
(vlax-put-property (vlax-get-property Range 'Font) 'Name FontName)
(if (= (Dxf 0) "MTEXT") (setq String (ClearMTFormat String)))
(vlax-invoke-method Range 'InsertAfter (strcat String "\n"));<--INSERT-->\n <CENTER BOLD> TITLE \n<CENTER BOLD> FILE \nLOCAL PROJETCT: <BOLD> TxtSet\nMSGbody_DOCZX
(setq Count (1+ Count))
);end repeat
(if (vl-catch-all-error-p (vl-catch-all-apply 'vla-saveas (list NewDoc File)))
(prompt "\nProbably selected file is read-only. Cannot export text to this file. ")
(vla-saveas NewDoc File);;; save document
);end if
(cond
((not Flag#1)
(vla-quit Word 0)
)
(T (if (not Flag#2) (vla-close NewDoc));;; close application
(vla-put-visible Word :vlax-true);;; show application
)
);end cond
(mapcar 'vlax-release-object (list Word NewDoc Paragraphs Range));;; objects release
(mapcar '(lambda (x) (set x nil)) '(Word NewDoc Paragraphs Range));;; null all variables
)
(T (prompt "\nCan't create Word document. Microsoft Ofice must be installed. "))
);end cond Word
)
(T (prompt "\nFile no selected. "))
);end cond
)
(T (prompt "\nNothing selected. "));;; text no selected
);end cond
(princ))

)));end c:dcc

 

(defun MSGbody_DOCZX ();;; list of open Word documents
(princ "TO DAY I NEED A LSP FOR JOB...... BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA...."))

(defun MSGbody_DOCZY ();;; list of open Word documents
(princ "TO DAY I NEED A LSP FOR JOB...... BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA...."))

(defun MSGbody_DOCZ ();;; list of open Word documents
(princ "TO DAY I NEED A LSP FOR JOB...... BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....
\n BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA....BLA...."))

 

0 Likes
899 Views
10 Replies
Replies (10)
Message 2 of 11

Sea-Haven
Mentor
Mentor

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

  

0 Likes
Message 3 of 11

rolisonfelipe
Collaborator
Collaborator

I'm not a programmer, but this fragment you made is too complex to understand, so much more complex than the lsp that I'm trying to edit, but every lsp is a challenge....

 

....this is the original code.....

 

;;; CADALYST 08/05 Tip 2053: SaveDoc.lsp Text into a MS Word File (c) Andrzej Gumula


;;; This routine exports selected text to Word document
;;; Microsoft Office must be installed in Windows
;;; *********************************************************
;;; Andrzej Gumula
;;; ul. Modrzewiowa 19/54
;;; 40-171 Katowice POLAND
;;; email: a.gumula@wp.pl

(defun c:sd (/ TxtSet Word Docs NewDoc Paragraphs Range
OldTxtList NewTxt IdTxtList FontName Txt Count
Flag#1 Flag#2)

(defun Dxf (Index)
(cdr (assoc Index (entget (ssname TxtSet Count))))
);end Dxf

(defun ClearMTFormat (Str / Item TLength Char New);;; clear mtext format in string
(setq Item 1 TLength (strlen Str) New "")
(while (<= Item TLength)
(setq Char (substr Str Item 1))
(if (= Char "\\")
(progn
(setq Item (1+ Item))
(setq Char (substr Str Item 1))
(cond
((member Char '("\\" "f" "F" "C" "H" "S" "T" "Q" "W"))
(while (and (/= Char ";") (<= Item TLength))
(setq Item (1+ Item))
(setq Char (substr Str Item 1))
);end while
)
((= Char "P")
(setq New (strcat New "\n"))
)
((member Char '("{" "}"))
(setq New (strcat New Char))
)
);end cond
);end progn
(if (not (member Char '("{" "}")))
(setq New (strcat New Char))
);end if
);end if
(setq Item (1+ Item))
);end while
(cond (New) (T ""))
);end ClearMTFormat

(defun GetOpenDocs (Docs / Item Names);;; list of open Word documents
(repeat (setq Item (vla-get-count Docs))
(setq Names (cons (strcase (findfile (vla-get-fullname (vla-item Docs Item)))) Names))
(setq Item (1- Item))
);end repeat
Names
);end GetOpenDocs

(princ "\nSelect TEXT (MTEXT) to export to Word document: ")
(cond
((setq TxtSet (ssget '((0 . "*TEXT"))))
(cond
((setq File (getfiled "Select Word document" (strcat (vl-filename-base (getvar "dwgname")) ".doc") "doc" 1))
(vl-load-com)
(prompt "\nExport text to Word. Please wait...")
(princ)
(if (not (setq Word (vlax-get-object "Word.Application")));;;is already open ?
(setq Word (vlax-get-or-create-object "Word.Application"));;; no open
(setq Flag#1 T)
);end if
(cond
(Word
(if (not Flag#1) (vla-put-visible Word :vlax-false));;; hide window application
(if (findfile File)
(setq Flag#2 (member (strcase (findfile File)) (GetOpenDocs (vlax-get-property Word 'Documents)))
NewDoc (vlax-invoke-method (vlax-get-property Word 'Documents) 'Open File))
(setq NewDoc (vlax-invoke-method (vla-get-documents Word) 'add))
);end if
(setq Paragraphs (vlax-get-property NewDoc 'Paragraphs) Count 0)
(repeat (sslength TxtSet)
(setq String (vla-get-TextString (vlax-ename->vla-object (ssname TxtSet Count))))
(setq Range (vlax-get-property (vlax-get-property Paragraphs 'last) 'Range))
(if (not (setq FontName (cdar (cdadr (assoc -3 (entget (tblobjname "STYLE" (Dxf 7)) '("ACAD")))))))
(setq FontName (vl-filename-base (cdr (assoc 3 (tblsearch "STYLE" (Dxf 7))))))
);end if
(vlax-put-property (vlax-get-property Range 'Font) 'Name FontName)
(if (= (Dxf 0) "MTEXT") (setq String (ClearMTFormat String)))
(vlax-invoke-method Range 'InsertAfter (strcat String "\n"))
(setq Count (1+ Count))
);end repeat
(if (vl-catch-all-error-p (vl-catch-all-apply 'vla-saveas (list NewDoc File)))
(prompt "\nProbably selected file is read-only. Cannot export text to this file. ")
(vla-saveas NewDoc File);;; save document
);end if
(cond
((not Flag#1)
(vla-quit Word 0)
)
(T (if (not Flag#2) (vla-close NewDoc));;; close application
(vla-put-visible Word :vlax-true);;; show application
)
);end cond
(mapcar 'vlax-release-object (list Word NewDoc Paragraphs Range));;; objects release
(mapcar '(lambda (x) (set x nil)) '(Word NewDoc Paragraphs Range));;; null all variables
)
(T (prompt "\nCan't create Word document. Microsoft Ofice must be installed. "))
);end cond Word
)
(T (prompt "\nFile no selected. "))
);end cond
)
(T (prompt "\nNothing selected. "));;; text no selected
);end cond
(princ)
);end c:sd

 


(prompt "\nLoaded new command Save2Doc [SD]. ")
(prompt "\n[c]2004 Andrzej Gumula. ")
(princ)

;************** in the future - maybe in next version ?
;(vlax-invoke-method Range 'InsertSymbol 176 nil) ;degree%%d
;(vlax-invoke-method Range 'InsertSymbol 177 nil t) ;plus-minus%%p
;(vlax-invoke-method Range 'InsertSymbol 216 nil t) ;diameter%%c

 

 

 

 

0 Likes
Message 4 of 11

john.uhden
Mentor
Mentor

I can't even stomach looking at it with no indentation.

John F. Uhden

0 Likes
Message 5 of 11

rolisonfelipe
Collaborator
Collaborator

@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  



@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  



@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  



@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  



@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  



@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  



@Sea-Haven wrote:

I had a go at using it, changed the dcl part to as below, this line is a problem (setq TILE (getvar "DECRITION")); so remmed it out. It did not work for me. There were errors also you labelled each key DOC1, there is something wrong with your pick a toggle I stopped at this point debugging. 

 

Word appears to have changed with current version you were abl to do some copy and paste between acad and word but it does not like it now.

 

 

 

(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
(write-line " DOC : dialog " fo)
(write-line (strcat "{ label = " (chr 34) "OFFICE" (chr 34) "; ") fo)
(write-line ": row { " fo)
(write-line ": column { " fo)
(write-line (strcat ": toggle { label = " (chr 34) "DOC X" (chr 34) " ; key = " (chr 34) "DOCX" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle  {label = " (chr 34) "DOC Y" (chr 34) "; key = "  (chr 34) "DOCY" (chr 34) "; } ") fo)
(write-line  (strcat ": toggle { label = " (chr 34) "DOC Z" (chr 34) "; key = " (chr 34) "DOCZ" (chr 34) "; }}} ") fo)
(write-line  (strcat ": button { label = " (chr 34) "EXIT" (chr 34) " ; key =" (chr 34) "BT-SAIR" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; } ") fo)
(write-line  (strcat " : button { label = " (chr 34) "GO DOC" (chr 34)  "; key =" (chr 34) "BT-GODOC" (chr 34) " ; fixed_width=true ; width=0 ; alignment=centered ; is_default=true ; } ") fo)
(write-line "} " fo)
(close fo)
.....
.....
(setq dcl_id (load_dialog fname))
  (if (not (new_dialog "DOC" dcl_id))
    (exit)
  )
; (new_dialog "DOC" ARQ_DCL)

 

 

 

  


what I want is that in the dcl I can select more than one doc, and generate them simultaneously because the input base is the same as all texts

0 Likes
Message 6 of 11

john.uhden
Mentor
Mentor
I really haven't been paying much attention, but if you put your document
names in a list_box with multiple_select = true then you can select
multiple entries in the list_box.
I think you can even use Ctrl+A to select all, or at least Shift+Arrow down.

John F. Uhden

0 Likes
Message 7 of 11

rolisonfelipe
Collaborator
Collaborator

John F. Uhden, so I can only thank you for your collaboration,  thank you!!!

0 Likes
Message 8 of 11

Sea-Haven
Mentor
Mentor

I tried the original code and it works, but its not a true mtext to word as it drops text fonts if you have a mixture in the paragraphs. Not sure if this can be corrected unless looking for all the control strings in Mtext.

 

The write dcl is a common function that is worth looking into for simple dcl like this task it means that you dont need 2 files a dcl and lisp. 

 

You should always state that the code came from some where even a simple 1 line reference.

 

; Thanks to Andrzej Gumula Cadalyst tip 2053 for original code

; Modified by BIGAL Jan 2021

 

 

Message 9 of 11

rolisonfelipe
Collaborator
Collaborator

ow, sorry for the inelegance, I will do it now, as I didn't notice it in the other posts

 

; Thanks to Andrzej Gumula Cadalyst tip 2053 for original code

; Modified by BIGAL Jan 2021

0 Likes
Message 10 of 11

Sea-Haven
Mentor
Mentor

Thats ok its good to refernce a Author as often they will see and offer more help.

Message 11 of 11

rolisonfelipe
Collaborator
Collaborator

that's the goal, generate docs according to dcl, from one to several docs in a single click, that have the same entry, type: file name, title, and identical strigs the rest and text type \n blablabla\n blablabla\n blablabla..

 

good observation😎

0 Likes