Jump to content

Search the Community

Showing results for tags 'loop instruction'.

  • 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 new here. So, please, be gentle. I had a problem with a routine. I have to open all the drawings in the same folder, compare a specific area of the drawing with a reference and change that area, if necessary. But I have a lot of references to compare, so I need to do that many times. I've already got a batch to open all the drawings in the same folder. So I just modified it to compare the area with the reference and it worked greatly. The only problem is: When i put that batch inside a loop instruction (to change the reference that will be compared), the batch didn't worked. The following error appears: ; error: bad argument type: streamp nil Here goes the code. Could someone help me? (defun c:testloop (/) (setq c 1) (while ( (c:opendrawings) (setq c (1+ c)) ); end while ); end function to test the loop (defun c:opendrawings (/ 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")) (progn (foreach f dwglist (if (and (not (Is_ReadOnly f)) (/= (checkAttFile f) 1) ) (progn (write-line (strcat "_.open \"" f "\"") openfile) (write-line "_.audit _y" 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 function to open all the drawings
×
×
  • Create New...