Oops ... I accidentially put some xrefs on the wrong layer ...

Oops ... I accidentially put some xrefs on the wrong layer ...

Anonymous
Not applicable
371 Views
3 Replies
Message 1 of 4

Oops ... I accidentially put some xrefs on the wrong layer ...

Anonymous
Not applicable

I have a project with 100 sheets in the set...

 

We use xrefs to manage our revision dates centrally...unfortunately I had accidentially put these xrefs on revision layers (A-REV-01 and A-REV-02) instead of layer 0.

 

Rather than change this manually ... I would like to write a script to address this issue.

 

I have never written a script that would select an item (a specific xref and then change its layer)... in this case I have two separate xrefs and to separate layers that i want to move ...

 

any input would be helpful

0 Likes
372 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor

@Anonymous wrote:

I have a project with 100 sheets in the set...

 

We use xrefs to manage our revision dates centrally...unfortunately I had accidentially put these xrefs on revision layers (A-REV-01 and A-REV-02) instead of layer 0.

 

Rather than change this manually ... I would like to write a script to address this issue.

 

I have never written a script that would select an item (a specific xref and then change its layer)... in this case I have two separate xrefs and to separate layers that i want to move ...

 

any input would be helpful


Hi jthornton23MF3,

by 'script' do you mean a '*.scr' file?

If so, I so, I think that a '*.scr' file can not do that job...

 

If you mean a '*.lsp' file, we can't acess sheetsets using Auto/Visual LISP.

 

An Auto/Visual LISP routine may be written to change xrefs layer to '0' but you can't  use it in sheet set manager, you'll have to open/run the routine in each dwg file...

 

Henrique

EESignature

0 Likes
Message 3 of 4

voseo
Contributor
Contributor

Hi - Try this...  may work!

 


(defun c:movexrefstolayerzero ( / ss1 k ss1len ce)
 (setq ss1 (ssget "x" (list (cons 0 "INSERT"))))
 (setq k 0)
 (setq ss1len (sslength ss1))
 (while (< k ss1len)
  (setq ce (ssname ss1 k))
  (if (= 4 (logand (cdr (assoc 70 (entget (tblobjname "block" (cdr (assoc 2 (entget ce)))))))4))
   (vla-put-layer (vlax-ename->vla-object ce) "0")
  )
  (setq k (+ 1 k))
 )
 (princ)
)

0 Likes
Message 4 of 4

pbejse
Mentor
Mentor
0 Likes