Jump to content

Search the Community

Showing results for tags 'write text at a point'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. Hello, guys! I'm creating a lisp to open multiple DWG's in a directory and alterate a number at a especific position. I have a function (called txt) to write the number at a position and I have another function (called change_all) to open every DWG in the directory and execute the function "txt". I want that the "Change_all" asks me the number and then execute the "txt" to write that number in all DWG's. The functions are already working, but i couldn't call the "txt" with the parameter number previously defined Here are the code: (defun c:txt (tval) ; (setq num0 (ssget "_C" '(347.06 18.12) '(350.90 18.12))) ; (command ".erase" num0 "" ); (setq pt1 '(346.5 15.84)) ; (if (not (tblsearch "Layer" "TEXT")) (command "-layer" "m" "TEXT" "") ) ;_ end if (entmake (list '(0 . "TEXT") '(8 . "TEXT5") (cons 10 pt1) (cons 40 4.5) (cons 1 tval) '(50 . 0.0) '(7 . "ROMANS") '(71 . 0) '(62 . 4) '(72 . 0) '(73 . 0) ) ;_ end list ) ;_ end entmake (*error* "") (princ) ) ;_ end defun (defun c: change_all (/ dwglist dwgname dwgpre file openfile uhoh len) (vl-load-com) (if (and (setq dwgpre (getvar 'dwgprefix)) (setq dwglist (vl-sort (vl-remove (strcat dwgpre (getvar 'dwgname)) (mapcar '(lambda (dwgname) (strcat dwgpre dwgname)) (vl-directory-files dwgpre "*.dwg") ) ) ' ) ) (setq uhoh "Readonly drawings will not be processed!" ) (setq len (strlen uhoh)) ) (progn (setq openfile (open (setq file (strcat dwgpre "myscript.scr")) "w")) (setq num (getstring t "\nType the numer: ")) ; (progn (foreach f dwglist (if (and (not (Is_ReadOnly f)) (/= (checkAttFile f) 1) ) (progn (write-line (strcat "_.open \"" f "\"") openfile) (write-line "(C: (txt num))" openfile) ; (write-line "_.qsave _.close" openfile) ) (setq uhoh (strcat uhoh "\n" f)) ) ) (close openfile) (command "_.script" file) (if (= (strlen uhoh) len) (princ "All drawings successfully processed...") (alert uhoh) ) ) ) ) (princ) ) ; End Defun Could someone help me, please?
×
×
  • Create New...