Jump to content

Search the Community

Showing results for tags 'switch back'.

  • 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. I am creating a copy from a drawing with Autolisp and creating a script which will be dettaching all xrefs on the copy. After saving the copy, the last command of the script is "close", then I would like to go back to the original drawing from where the copy was made from. This is not happening if there are some other drawings opened, then it makes active the last opened drawing. I need an automatic process since I will not be the final user and they might get confused. Here it is the code: (defun run (/ mc_scr) (setq switch_dwg (strcat (getvar 'dwgprefix) (getvar 'dwgname) ) ) (setq mc_scr (open (strcat (getenv "temp") "\\mc.scr") "w")) (foreach mem0 (list "open" (strcat "\"" new_c "\"") "(setq opn_dwg_lst nil)" "(vlax-for" " x" " (vla-get-documents" " (vlax-get-acad-object)" " )" " (setq opn_dwg_lst (cons x opn_dwg_lst))" ")" "-xref" "d" "*" "-purge" "a" "*" "n" "_ucs" "_w" "_plan" "_w" "_zoom" "_e" "(foreach SYM_MEM opn_dwg_lst" " (if " " (=" " (strcat" " \"A\"" " (substr" " (getvar \"dwgname\")" " 2" " )" " )" " (vla-get-name SYM_MEM)" " )" " (setq SYM_A SYM_MEM)" " )" ")" "qsave" "close" "(vla-activate SYM_A)" ) (write-line mem0 mc_scr) ) (close mc_scr) ) (defun mc (/ new_c mc) (setvar 'CMDECHO 0) (if (= (substr (getvar 'dwgname) 1 2 ) "A_" ) (progn (command "qsave") (setq new_c (strcat (getvar 'dwgprefix) (vl-string-subst "B_" "A_" (getvar 'dwgname)) ) ) (cond ( (/= (findfile new_c) nil) (command "save" new_c "y") (run) ) (T (command "save" new_c) (run) ) ) (command "script" (strcat (getenv "temp") "\\mc.scr")) ) ) (setvar 'CMDECHO 1) (princ) ) (mc) Any clue? thanks in advance Svorgodne
×
×
  • Create New...