Jump to content

Request For Assistance In Editing Texts


mehrdad

Recommended Posts

Greetings to dear companions,

 

I have a question. I have 200 sheets of drawings that are A2 size, and in the revision section, I want to copy all the text like "rev.0" and change only the date in "rev.1." It is worth mentioning that the position of all revisions on the 200 sheets is the same.


Thank you very much for your help!

 

 

 

 

 

17276793991942364798086139715681.jpg

Edited by mehrdad
Link to comment
Share on other sites

If it is one text this will copy and overwrite an existing text:

https://lee-mac.com/copytext.html#:~:text=This program enables a user to copy the

 

This one should change a text to 'todys' date

 

(defun c:txttoday ( / ent endloop delim ayear amonth)

  (defun LM:stringsubst ( new old str / pos )
    (if (setq pos (vl-string-search (strcase old) (strcase str)))
      (strcat (substr str 1 pos) new (LM:stringsubst new old (substr str (+ 1 pos (strlen old)))))
      str
    )
  )

  (if (= deliminator nil)
    (progn
      (setq deliminator "/")
      (setq dformat "m=$(edtime,0,dd/mo/yy)" )
    )
  )

  (if (= dformat nil)(setq dformat "m=$(edtime,0,dd/mo/yy)" ))
  (setq delim deliminator)

  (setq endloop "No")
  (setq optionstext "Deliminators: . - or / \nMonth Format: MO MON MONTH\nYear Format: YY YYYY\nYY-MM-DD Format: REV STD")
  (while (= endloop "No")
    (initget "/ . - mo mon month MO MON MONTH YYYY YY yyyy yy rev REV std STD ? Exit")
    (setq sel (nentsel (strcat "\nSelect Text, deliminator (" delim "), option, or (?) : ") ) )
    (cond
      (  (null sel)(princ "\nMissed! Select text, or enter deliminator or press <escape> or 'E'\n") )
      (  (= "Exit" sel)(princ)(exit) )

      (  (= "/" sel)(setq delim "/") )
      (  (= "." sel)(setq delim ".") )
      (  (= "-" sel)(setq delim "-") )
      (  (= "?" sel)(alert optionstext) )
      (  (or (= "yyyy" sel)(= "YYYY" sel))(setq ayear "yyyy") )
      (  (or (= "yy" sel)(= "YY" sel))(setq ayear "yy") )
      (  (or (= "rev" sel)(= "REV" sel))(setq ayear "can") )
      (  (or (= "std" sel)(= "STD" sel))(setq ayear "std") )
      (  (or (= "month" sel)(= "MONTH" sel))(setq amonth "month") )
      (  (or (= "mon" sel)(= "MON" sel))(setq amonth "mon") )
      (  (or (= "mo" sel)(= "MO" sel))(setq amonth "mo") )

      (  (if (and (cdr (assoc 1 (entget (car sel))))(wcmatch (cdr (assoc 0 (entget (car sel)))) "TEXT,MTEXT,ATTRIB") ) (setq endloop "Yes")) )
      (  (if (not (wcmatch (cdr (assoc 0 (entget (car sel)))) "TEXT,MTEXT,ATTRIB") ) (princ "\nThats not text...\n")) )
    )
  ) ;;end while

  (if (and (/= delim nil)(/= delim deliminator))
    (progn
      (setq dformat (LM:stringsubst delim deliminator dformat))
      (setq deliminator delim)
    )
  )

  (if (= ayear "yyyy")(setq dformat (LM:stringsubst (strcat deliminator "yyyy)") (strcat deliminator "yy)") dformat) ))
  (if (= ayear "yy")(setq dformat (LM:stringsubst (strcat deliminator "yy)") (strcat deliminator "yyyy)") dformat) ))
  (if (= ayear "std")(setq dformat "m=$(edtime,0,dd-mo-yy)" ))
  (if (= ayear "can")(setq dformat "m=$(edtime,0,yyyy-mo-dd)" ))

  (setq ent (car sel))
  (vla-put-textstring (vlax-ename->vla-object ent) (menucmd dformat))
  (command "regen")
  (princ)
)

 

 

Both the above will change exiting text.

 

However looking at your screen shot it looks like the text is new text and also 200 sheets. So are the 200 sheets in a single drawing, is it 200 drawings with a single sheet or a combination multiple sheets in many drawings? That will affect how you add the texts. Second question from this is are all the text locations in the same position and will all the sheets be changing the same revision, for example if 25 drawings are A3 sheets and 25 drawings are A0 sheets the text needs to be positioned in different places, and if say 25 sheets are at rev D01 and 25 are at rev D03 again the text will be in different positions. In both cases you'd need to think about some code to calculate sheet size and revision before placing the text.

 

 

Simplest way would be a LISP to paste text at a location.

 

These 2 snippets are to add and get text from the clipboard:

(defun SetClipBoardText ( MyText / htmlfile result )
  (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" Mytext)
  (vlax-release-object htmlfile)
  (princ)
)
(defun GetClipBoardText ( / htmlfile result )
  (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'getData "Text"))
  (vlax-release-object htmlfile)
  result
)

 

One code I have is to grab the date (user selects the text in each case), concatenate a delimitator (I use '**---**---**' which would never occur in any drawing) and the 2nd text string, using setclipboardtext above to copy that line to the clipboard. Then have a second routine to paste the text use Lee Macs String to List (https://lee-mac.com/stringtolist.html) and the delimitator to split the clipboard text up and create new text where you want it to be.

Link to comment
Share on other sites

Thank you very much for your detailed answer. Steven P

All drawings are A2 size. The position of all text is the same. I want to select their folder like BFIND.LSP and have them all copied after a few minutes or something like that.

 

 

Edited by mehrdad
Link to comment
Share on other sites

Greetings to you, hosneyalaa. Thank you for your cooperation. 
I would like the "30.09.24 APPROVED FOR CONSTRUCTION" and its continuation to be produced in the other drawings that are in a folder, as they do not currently exist.

20240930_160338.jpg

Link to comment
Share on other sites

The screenshot is great however to make anything up we'd need to know details that are in the drawing, so can you post a sample - doesn't have to be anything much just the title block positioned as it should be.

Link to comment
Share on other sites

Thank you very much for your follow-up. Yes, I understand. I am attaching a CAD file, and in row D1 under DESCRIPTION, if possible, I would like to be able to write any necessary words in PREP'D, CHK'D, APP'D based on the project requirements.

10-HFG1600631001-G01-N_Sht_1.dwg

Edited by mehrdad
Link to comment
Share on other sites

Ok my answer, the simplest way around this but its a fix for future is make a title block or blocks, you could have a revision block ie D01 D02 etc, you would have attributes much easier to find and update. 

 

With a revision block you can do stuff like "add revision" it finds last entry then goes 1 above asking for details.

 

Ok the answer to your question is you can get text at a XY position and replace, the issue is if one of your dwg's is offset it may find wrong text. You need to use "fence" to find the text.

(setq pts (list (list 252 34)(list 278 34)))
(setq txt (ssget "f" pts))

 

Have you thought about making a single dwg with 200 layouts ? Makes stuff like plotting, sheet numbering much easier. Yes can copy from another dwg and insert into a new layout. I like others have lots of lisp's based around this approach including make Index.

 

I would find all the rev details and put in a rev blocka s first fix. Would that be helpful ?

 

 

 

  • Like 1
Link to comment
Share on other sites

Hello BIGAL, thank you for your response. 

 

However, since my knowledge of Lisp is very limited, unfortunately, I didn’t quite understand. What I want is, if possible, that as soon as I open a new drawing, or in any way that is feasible, all the new information such as the date, descriptions, producer, and verifier are entered in row D01.

 

Thank you again for your help!

Link to comment
Share on other sites

try this :

;;; rlx 2024-10-01 - https://www.cadtutor.net/forum/topic/91692-request-for-assistance-in-editing-texts/
(defun c:Mehrdad ( / doc actLay actDoc actDocs actApp actDbx AllOpen dir lst x-list y-list y z save)
  (vl-load-com)
  (setq x-list (list 252.0 280.0 360.0 375.0 388.0) y-list (list 26.5 33.0 39.5 46.0 52.5 59.0 65.5) z 0.0)
  (setq s-list (list (now) "APPROVED FOR CONSTRUCTION" "R.S" "A.SH" "RLX"))
  ;;; set y coordinate for row D1
  (setq y (nth 1 y-list))
  (if (and (setq dir (GetShellFolder "Select Folder")) (vl-consp (setq lst (alldrawings dir))))
    (foreach dwg lst
      (if (setq doc (odbx_open dwg))
        (progn
          (mapcar '(lambda (txt x) (addtext_dbx doc txt (list x y z) 3.125)) s-list x-list)
          (if (vl-catch-all-error-p (setq save (vl-catch-all-apply 'vla-saveas (list doc dwg))))
            (alert (strcat  "Save error: "
             (vl-catch-all-error-message save) "\ndrawing : " (vl-princ-to-string dwg))))
        )
        (princ (strcat "\nUnable to open : " dwg))
      )
    )
  )
  (_ReleaseAll)
  (princ "\nDone.")
  (princ)
)

;;; --- Odbx ---------------------------------------------- Begin Odbx Section ----------------------------------------------- Odbx --- ;;;

(defun GetAllOpenDocs ()
  (or actApp (setq actApp (vlax-get-acad-object))) (or actDoc (setq actDoc (vla-get-ActiveDocument actApp)))
    (or actDocs (setq actDocs (vla-get-documents actApp)))
  (vlax-for doc actDocs (if (= 1 (vlax-variant-value (vla-getvariable doc "DWGTITLED"))); no nameless drawings
    (setq AllOpen (cons (cons (strcase (vla-get-fullname doc)) doc) AllOpen))))
)

(defun _ReleaseAll ()
  (mapcar '(lambda(x) (if (and (= 'vla-object (type x)) (not (vlax-object-released-p x)))
    (vlax-release-object x))(set x nil)) (list 'doc 'actLay 'actDoc 'actDocs 'actApp 'actDbx))(gc))

(defun _InitObjectDBX ()(or actApp (setq actApp (vlax-get-acad-object)))
  (or actDoc (setq actDoc (vla-get-ActiveDocument actApp)))(or AllOpen (setq AllOpen (GetAllOpenDocs)))
  (setq actDbx (vl-catch-all-apply 'vla-getinterfaceobject (list actApp (dbx_ver))))
  (if (or (null actDbx)(vl-catch-all-error-p actDbx))(progn (princ "\nObjectDbx not available")(setq actDbx nil)))
  actDbx
)

(defun odbx_open ( $dwg / _pimp doc) (or AllOpen (GetAllOpenDocs))
  (defun _pimp (s) (strcase (vl-string-trim " ;\\" (vl-string-translate "/" "\\" s))))
  (cond ((or (void $dwg) (not (findfile $dwg)))(princ "\nInvalid drawing")(setq doc nil))
	((not (or actDbx (_InitObjectDBX)))(princ "\nObjectDbx not available")(setq doc nil))
        ((setq doc (cdr (assoc (_pimp $dwg) AllOpen))))
	((vl-catch-all-error-p (vl-catch-all-apply 'vla-Open (list actDbx (findfile $dwg))))
	 (princ "\nUnable to open drawing.")(setq doc nil))
	(t (setq doc actDbx)))
  doc
)

(defun odbx_close ( %doc ) (if (and (= 'vla-object (type %doc))
  (not (vlax-object-released-p %doc)))(progn (vlax-release-object %doc))(setq %doc nil)))

(defun dbx_ver ( / v) (strcat "objectdbx.axdbdocument" (if (< (setq v (atoi (getvar 'acadver))) 16) "" (strcat "." (itoa v)))))

;;; --- Odbx ---------------------------------------------- End Odbx Section ------------------------------------------------- Odbx --- ;;;



;;; --- Tiny Lisp ---------------------------------------- Begin of Tiny Lisp ------------------------------------------- Tiny Lisp --- ;;;

; generic getfolder routine with possibility to create a new subfolder (GetShellFolder "select path")
(defun GetShellFolder ( m / f s) (if (and (setq s (vlax-create-object "Shell.Application"))
  (setq f (vlax-invoke s 'browseforfolder 0 m 65536 "")))(setq f (vlax-get-property (vlax-get-property f 'self) 'path))
     (setq f nil))(vl-catch-all-apply 'vlax-release-object (list s))
  (if f (strcat (vl-string-right-trim "\\" (vl-string-translate "/" "\\" f)) "\\")))

;;; (getsubfolders "c:/temp/lisp")
(defun getsubfolders ( d / l r s )(setq d (Dos_Path d))(setq l (list (vl-string-trim "/\\" d)))(while l (setq s nil)
  (foreach d l (setq s (append s (mapcar (function (lambda (x)(strcat d "\\" x))) (vl-remove-if (function
    (lambda (x)(member x '("." ".."))))(vl-directory-files d nil -1)))))) (setq r (append s r) l s))
  (cons d (mapcar 'Dos_Path r))
)

(defun Dos_Path ($p) (if (= (type $p) 'STR)
  (strcase (strcat (vl-string-right-trim "\\" (vl-string-translate "/" "\\" $p)) "\\")) ""))

(defun alldrawings ( d / s l r) (setq l (mapcar 'Dos_Path (getsubfolders d)))
  (foreach s l (setq r (append r (mapcar '(lambda (x)(strcat s x))(vl-directory-files s "*.dwg" 1))))) r)

;;; s = string , p = insertion point , h = text height
(defun addtext_dbx (d s p h / o a) (setq o (vla-AddText (vla-get-ModelSpace d) s (vlax-3d-point p) h)))

(defun now ( / ns) (setq ns (rtos (getvar "CDATE")) ns (strcat (substr ns 7 2) "-" (substr ns 5 2) "-" (substr ns 1 4))))

;;; --- Tiny Lisp ---------------------------------------- Begin of Tiny Lisp ------------------------------------------- Tiny Lisp --- ;;;

(c:Mehrdad)

 

I'm still very busy , so chances are I won't be able to handle any snowball' requests ('thanx , but could you also....') so I disabled all notifications from cad-tutor for now.

 

🐉

Link to comment
Share on other sites

 

Thank you for the program you wrote. I loaded this program by entering "Mehrdad" and provided the folder address, but I didn't see any changes. I opened 5 of the files again and repeated these steps, but still had no results. However, I eventually realized that there is an error in the program. Please let me know if I did something wrong. I really appreciate your help.

 

; error: no function definition:VOID

Edited by mehrdad
Link to comment
Share on other sites

I ran it without any probems , just saved your drawing 3 times for testing

 

image.png.76ce5a47896caee4da835c9a7210b4f1.png

 

oh darn , the void thing , I checked if I used it here but guess I overlooked it , my bad :

 

 

 

(defun void (x)
  (or (eq x nil) (and (listp x)(not (vl-consp x))) (and (eq 'STR (type x)) (eq "" (vl-string-trim " \t\r\n" x)))))

 

you may want to change line 5 , the line with s-list , didn't know who APP'd it so I used "RLX" but you probably wish to put another name here

  • Thanks 1
Link to comment
Share on other sites

Greetings to rlx,

 

I am very grateful to you for writing this program, which has significantly reduced my work time, and this is highly appreciated. 

 

However, I have a question: Considering that the date may not always be the current date, is it possible for the date to be written in the program and then entered like before? Also, instead of the date format being 01-10-2024, could it be written as 01-10-24?

 

Thank you once again.

 

Link to comment
Share on other sites

(defun c:Mehrdad ( / doc actLay actDoc actDocs actApp actDbx AllOpen dir lst x-list y-list y z save data)
  (vl-load-com)
  (setq x-list (list 252.0 280.0 360.0 375.0 388.0) y-list (list 26.5 33.0 39.5 46.0 52.5 59.0 65.5) z 0.0)
   ;;; if you want to preset another date , change line to something like (setq date "01-02-25")
  (setq date (now))
  (setq s-list (list date "APPROVED FOR CONSTRUCTION" "R.S" "A.SH" "A.SH"))
  ;;; set y coordinate for row D1
  (setq y (nth 1 y-list))
  (if (and (setq dir (GetShellFolder "Select Folder")) (vl-consp (setq lst (alldrawings dir))))
    (foreach dwg lst
      (if (setq doc (odbx_open dwg))
        (progn
          (mapcar '(lambda (txt x) (addtext_dbx doc txt (list x y z) 3.125)) s-list x-list)
          (if (vl-catch-all-error-p (setq save (vl-catch-all-apply 'vla-saveas (list doc dwg))))
            (alert (strcat  "Save error: "
             (vl-catch-all-error-message save) "\ndrawing : " (vl-princ-to-string dwg))))
        )
        (princ (strcat "\nUnable to open : " dwg))
      )
    )
  )
  (_ReleaseAll)
  (princ "\nDone.")
  (princ)
)

;;; "01-10-24"
(defun now ( / ns) (setq ns (rtos (getvar "CDATE")) ns (strcat (substr ns 7 2) "-" (substr ns 5 2) "-" (substr ns 3 2))))

 

  • Like 1
Link to comment
Share on other sites

Nice.

 

Was on holiday yesterday and you beat me to it. A slight different method, to have 6 little LISPs each with the details D0, D1, D2.... calling the text creation LISP. User can then just type in D1 and D1 revision details are completed. See below, each D0, D1, D2.... LISP will need the revision details amended to suit of course. Quick and simple though we could all go further and have the details entered when you call the LISP with a dialogue box... but... for the effort of doing that I think it is probably as efficient to just have the details hard coded and adjust as and when you need to. Could also look at the drawing suffix and maybe autocomplete from there (some of our clients have say _P1 suffix for the revision, something like "get filename last 2 digits, if = D0, then run D0")... could do a lot more with this... but... as above would it be worth the time to create it?

 

We have many clients and this method could also work with different title blocks, just adjust the coordinate details to make them fit (also in the D0, D1... LISPs). For a batch, RLX has it but you could use something like Lee Macs Scriptwriter: https://lee-mac.com/scriptwriter.html

 

;;;;;;;;;;;;;;;;;
(defun details ( / MyDate MyDesc Prep Chk App MyTexts) ;; Next revision details
;;User defined title block entries. Amend to suit.
  (setq MyDate "01.10.24")
  (setq MyDesc "Approved for Construction")
  (setq Prep "A.KH.")
  (setq Chk "E.E.")
  (setq App "R.KH.")


  (setq MyTexts (list MyDate MyDesc Prep Chk App)) ;Create list of text from above
)
;;;;;;;;;;;;;;;;;
(defun C:D6 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 65.5) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun C:D5 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 59) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun C:D4 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 52.5) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun C:D3 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 46) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun C:D2 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 39.5) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun C:D1 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 33) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun C:D0 ( / MyDate MyDesc Prep Chk App MyTexts X Y) ;;NIOC Border
  (setq X (list 252 280.5 360 375 388)) ; X Axis for texts
  (setq Y 26.5) ; Y axis for text
  (setq MyTexts (details)) ;Create list of text from above
  (setq RevFont "HTX1")
  (BorderInits X Y MyTexts RevFont)
)
;;;;;;;;;;;;;;;;;
(defun BorderInits ( X Y MyTexts RevFont / Acount Mytext MyPoint)
  (defun MakeTxt (MyText TextPoint Font / ) ; Create a text
    (entmakex (list
      '(0 . "TEXT")
      '(100 . "AcDbEntity")
      '(8 . "0")
      '(100 . "AcDbText")
      (cons 10 TextPoint)
      '(40 . 3.125) ;;Text Height. Adjust as necessary
;;      '(46 . 0.0)
      (cons 1 MyText)
      '(50 . 0.0)
      '(41 . 1.0)
      '(51 . 0.0)
      (cons 7 Font) ;;Font. See Rev_Font LISP
      '(71 . 0)
      '(72 . 0)
      '(11 0.0 0.0 0.0)
      '(210 0.0 0.0 1.0)
      '(100 . "AcDbText")
      '(73 . 0)
    ))
  )

  (setq thisdrawing (vla-get-activedocument (vlax-get-acad-object)))
  (vla-startundomark thisdrawing)

  ;; loop through MyTexts to create texts
  (setq acount 0)
  (while (< acount (length MyTexts))
    (setq MyText (nth acount MyTexts))
    (setq MyPoint (list (nth acount X) Y))
    (MakeTxt MyText MyPoint RevFont)
    (setq acount (+ acount 1))
  ) ; end while

  (vla-endundomark thisdrawing)
)

 

 

 

Edit... P.S. having a border exploded from a PDF with texts into lines would drive me mad! Haven't got anything to fix that though apart from retyping it all

 

Edit 2... added undo and put the revision details in their own routine

Edited by Steven P
Link to comment
Share on other sites

Unfortunately, it's still displaying the date as

01-10-2024

unless I'm mistaken.

Additionally, I'd like to request using the text style HTX1, as there are significant visual differences in the fonts.

To ensure the program is copied correctly, is it possible to save it as a separate file or copy the entire file here so we can reach a conclusion? Thank you once again for your cooperation. I can only send a screenshot from the program due to company restrictions on file shar

ing.

20241001_133850.jpg

Link to comment
Share on other sites

RLX code (he is busy so will drop a couple of hints, maybe you can try till he is free):

 

Date is controlled by (getvar "CDATE") line, change the delimitator "-" to what you prefer - should be easy to spot? If you don't want todays date there is a comment in his code to change '(DATE)' to for example "01-02-25".

 

Text style I think will be the current style, so you might want to change adding something like this

 

.... 
     (if (setq doc (odbx_open dwg))
        (progn

;;add these lines
(setq Old_Font (getvar 'textstyle) )
(setvar 'textstyle "HTX1")

.... do stuff

(setvar 'textstyle Old_Font)

        )
        (princ (strcat "\nU....

 

 

also added an alternative above - in LISP there are many ways to do something, mine you will need to run along with something like Scriptwriter which is a handy LISP to have in your library.

Edited by Steven P
Link to comment
Share on other sites

20241001_141801.thumb.jpg.a77e4928ab1d1ec2be1eced131ad46d3.jpgHello and thank you. I added this line: 'I'll attach an image,' but it still doesn't correct the date or use the HTX1 text style. Could you please send me the file directly to avoid any mistakes? I would be very grateful for your help.

 

Link to comment
Share on other sites

The font section needs to go after the (progn line - looks like you have added it before the (progn line. '... do stuff is the RLX code

 

 

.....
(if (setq doc (odbx_open dwg))
        (progn

;;add these lines
(setq Old_Font (getvar 'textstyle) )
(setvar 'textstyle "HTX1")


          (mapcar '(lambda (txt x) (addtext_dbx doc txt (list x y z) 3.125)) s-list x-list)
          (if (vl-catch-all-error-p (setq save (vl-catch-all-apply 'vla-saveas (list doc dwg))))
            (alert (strcat  "Save error: "
             (vl-catch-all-error-message save) "\ndrawing : " (vl-princ-to-string dwg))))

(setvar 'textstyle Old_Font)

        )
        (princ (strcat "\nUnable to open : " dwg))
      )
.....

 

Text string, as described above look through RLX code to see where it says to change it.. have a go.

 

 

 

 

EDIT:

Just checking this, for batch lisp you might also need to confirm you are in the right view, paperspace or modelspace - I'd usually draw in modelspace and include the borders in paperspace (makes some automation easier that way) and that the required font style is loaded into the drawing. If you will always be in model space and always have that font loaded then no worries.

 

RLX Code appears to work OK for me as described above.

 

Edited by Steven P
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...