asos2000 Posted May 18, 2013 Posted May 18, 2013 Hi all We using Xref in most of the project and all inserted in 0,0,0 point. Some user select xref while working and move it. I am wondering if there is a way to avoid this. Thnaks Quote
pBe Posted May 18, 2013 Posted May 18, 2013 One way to avoid, place the XREF on a locked layer. but of course you still can't "avoid" users from unlocking the layer , unless you use a reactor. Quote
satishrajdev Posted May 18, 2013 Posted May 18, 2013 Do you want to insert your Xref object file at insertion point which could be anything instead of 0,0.......Correct??? Quote
Lee Mac Posted May 18, 2013 Posted May 18, 2013 I agree with pBe - your best option is to place your XRefs on a locked layer and furthermore educate your colleagues to refrain from moving XRefs. Here is a short & simple program to move all XRefs to the origin: (defun c:x2or ( / def enx inc lst sel ) (while (setq def (tblnext "block" (null def))) (if (= 4 (logand 4 (cdr (assoc 70 def)))) (setq lst (vl-list* "," (cdr (assoc 2 def)) lst)) ) ) (if (and lst (setq sel (ssget "_X" (list '(0 . "INSERT") (cons 2 (apply 'strcat (cdr lst))) ) ) ) ) (repeat (setq inc (sslength sel)) (setq enx (entget (ssname sel (setq inc (1- inc))))) (entmod (subst '(10 0.0 0.0 0.0) (assoc 10 enx) enx)) ) ) (princ) ) Quote
asos2000 Posted May 18, 2013 Author Posted May 18, 2013 thanx pBe thanks Lee But I have to run the lisp every time i open or close the file Quote
Lee Mac Posted May 19, 2013 Posted May 19, 2013 But I have to run the lisp every time i open or close the file Load & run it from your ACADDOC.lsp Quote
alanjt Posted May 20, 2013 Posted May 20, 2013 Pick a dedicated *locked* layer for xrefs and leave them there. I'd even put a check in the startup to make sure the layer is still locked. XREFS moving isn't always a bad user, I've seen a large drawing, with many xrefs, hang or temporarily freeze, and while trying to see if the program was responding again, your click in the screen would inadvertently select and move the xref a bit. Of course, that's taking for granted the assumption that I'm not a bad user. Nice code, Lee. Unless the user works in a firm where the xrefs are treated like blocks (Architectural especially), that's probably a good thing to have in ones startup. Quote
irneb Posted May 20, 2013 Posted May 20, 2013 Nice code, Lee. Unless the user works in a firm where the xrefs are treated like blocks (Architectural especially), that's probably a good thing to have in ones startup.Yep, that was my first thought also. While this may help some, it's certainly not something I can actually use much - very few of my xrefs are actually placed on 0,0,0. Most are placed multiple times in different locations both mirrored and rotated: as if a room is repeated in different placed on the plan. If I ran this code all the rooms would move to overlap each other at the origin. The only xref which always resides on 0,0 is the gridlines and section lines - they should stay at the same spot relative to the building. I also tend to go with the locked layer approach, have to, no choice! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.