CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 2200
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

Change text style - AutoCAD drawing

 Post Reply Post Reply
Author
remcokoedoot View Drop Down
Groupie
Groupie


Joined: 16.Oct.2013
Location: Netherlands
Using: AutoCAD
Status: Offline
Points: 31
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
);setq 
 
(while (< count len)
       (setq ent      (ssname entities count) 
             ent_data (entget ent)
             ent_name (cdr (assoc 7 ent_data))
       );setq
 
(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))
);while
 
;;;runs same routine again, picking up Mtext this time.
 
);defun
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,094 seconds.