CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 2488
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum


HelpCAD discussion

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

The information that you provide in this form will make up your forum profile which can be viewed by other forum members. Your email address will only be visible by forum admin and moderators and will be used to send you Forum Notifications. To cancel your account, use the page Opt-out or contact

Change text style - AutoCAD drawing

 Post Reply Post Reply
remcokoedoot View Drop Down

Joined: 16.Oct.2013
Location: Netherlands
Using: AutoCAD
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote remcokoedoot Quote  Post ReplyReply Direct Link To This Post Topic: Change text style - AutoCAD drawing
    Posted: 16.Sep.2022 at 11:24
Change text style of a AutoCAD drawing. Lisp routine will be update the AutoCAD drawing to a specified Style for all text elements in a drawing. This lisp routine will be update the AutoCAD drawing to a specified Style for all text elements in a drawing

(defun C:CHANGESTYLE-TEXT-OBJECTS (/ entities len count ent ent_data ent_name new_style_name)
(command "STYLE" "NAMEOFSTYLE" "" "" "" "" "" "")
(setq entities (ssget "X" '((0 . "*TEXT")))
      len      (sslength entities)
      count 0
(while (< count len)
       (setq ent      (ssname entities count) 
             ent_data (entget ent)
             ent_name (cdr (assoc 7 ent_data))
(setq new_style_name (cons 7 "NAMEOFSTYLE"))
(setq ent_data (subst new_style_name (assoc 7 ent_data) ent_data))
(entmod ent_data)
(setq count (+ count 1))
;;;runs same routine again, picking up Mtext this time.
With kind regards,

Remco Koedoot
Back to Top

Related CAD tips:

 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

This page was generated in 0,047 seconds.