Hi @chris_swetcky,
I created a lisp file that automates the workaround proposed by @cbuli @john.vellek
Hope it helps all those suffering the same issue.. 🙂
(Tell me if any thing went wrong)
The lisp does the following:
- saves the current layer state..
- turns off all layers..
- Updates all viewports..
- For every layer:
- Freezes and offs every other layer..
- Updates all viewports
- Moves to the next layer
After finishing: It restores the layer state and removes it from saved layer states
+ Some error handling..
;;;
;;;
;;;
;;;
;;; This file was created by El-Shawadify to address an issue reported by Autodesk Community Members about ViewBase Command..
;;; The essue appears when opening a drawing that contains ViewBase ViewPorts, created in a different release of AutoCAD..
;;; Some of the objects disappear..
;;;
;;; The issue was reported several times, icluding the ones mentioned in these threads:
;;; http://forums.autodesk.com/t5/autocad-2013-2014-2015-2016-2017/acad-2017-viewbase-error/td-p/6241719/page/2
;;; http://forums.autodesk.com/t5/autocad-2013-2014-2015-2016-2017/viewbase-not-generating-drawings-correctly/td-p/6401401
;;;
;;; According to @cbuli @John Vellek in that thread:
;;; "This is a known bug but a Community clever user posted this workaround which appears to work properly for me.
;;; ---- Turn OFF all used layers.
;;; ---- Update the views .
;;; ---- Then turn on one layer. The missing parts should now show up in the updated view.
;;; ---- Repeat for as many layers as you have used"
;;;
;;;
;;; The purpose of this LISP now is to Automate this process for those suffering from the same essue
;;;
;;;
;;;
;;; ==============================================================================================================================
;;; You may use, distribute, modify this file - as long as you keep this header at the beginning..
;;;
;;; Regards,
;;; El-Shawadify
;;;
;;; June 24th, 2016
;;;
;;; My Profile On AutoDesk Community Forum:
;;; http://forums.autodesk.com/t5/user/viewprofilepage/user-id/2780584
;;; The slution that I automated was originally proposed by @cbuli in Auodesk Community..
;;; His profile page in the community:
;;; http://forums.autodesk.com/t5/user/viewprofilepage/user-id/3750495
;;; - Thank you very much @cbuli..
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;====================================================================== Main Defun
;
(defun C:VBUP(/ CurLayerProps CurLayerName
*error* msg OriginalErr Err
);
;
;====================================================================== Error Fuctions
;
(setq OriginalErr *error*)
(defun Err ( DimModErr)
(command-s "-layer" "a" "r" "BeforeVBUpdate" "d" "BeforeVBUpdate" "" "")
(command-s "undo" "end")
(setvar "CMDECHO" 1)
(princ (strcat "\nError: " DimModErr " The command was interrupted while Updating ViewBase ViewPorts, some elements may still be missing.."))
(setq *error* OriginalErr)
)
(Setq *error* Err)
;
;
;
;====================================================================== Command Main Body
;
(Command "Undo" "Begin")
(setvar "CMDECHO" 0)
(command "-layer" "a" "s" "BeforeVBUpdate" "" "" "")
(command "-layer" "off" "*" "y" "")
(command "ViewUpdate" "all")
;
;
(setq CurLayerProps (tblnext "LAYER" t))
(while CurLayerProps
(setq CurLayerName (cdr (cadr CurLayerProps)))
(command "-layer" "t" CurLayerName "on" CurLayerName "s" CurLayerName "f" "*" "off" "*" "y" "")
(command "-layer" "on" CurLayerName "" "regen")
(command "ViewUpdate" "all")
(setq CurLayerProps (tblnext "LAYER"))
)
;====================================================================== Revert Env. Changes
;
(command "-layer" "a" "r" "BeforeVBUpdate" "d" "BeforeVBUpdate" "" "")
(setvar "CMDECHO" 1)
(command "undo" "end")
(setq *error* OriginalErr)
);
;====================================================================== Command End
Lisp Attached..
Enjoy 🙂
Regards..