Message 1 of 2
Changes does't get saved...

Not applicable
12-31-2017
06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm running a LISP that changes color of all objects in the dwg to ByLayer.
Problem is that when I do this on an Xref that contains another Xref inside the changes for the "inner" xref doesnt get saved after re-opening.
only the primary Xref (the top one). My VISRETAIN var is set to 1
Can you please help me figure that out?
(defun c:fixcolor ( / obj vlobj mainBlock childEnt vlobj) ;; Unlock all layers (vlax-for lay (vla-get-Layers (vla-get-Activedocument (vlax-get-acad-object)) ) (if (= :vlax-true (vla-get-lock lay) ) (progn (vla-put-lock lay :vlax-false) (setq lay_lst (cons lay lay_lst)) ) ) ) ;Start with regular entities (setq obj (entnext)) (while obj (setq vlobj (vlax-ename->vla-object obj)) (vla-put-color vlobj 256) (setq obj (entnext obj)) ) ;Process entities within blocks (setq mainBlock (tblnext "block" t)) (while mainBlock (setq childEnt (cdr (assoc -2 mainBlock))) (while childEnt (setq vlobj (vlax-ename->vla-object childEnt)) (vla-put-color vlobj 256) (setq childEnt (entnext childEnt)) );end while (setq mainBlock (tblnext "block")) ) (command ".regen") (princ) )