Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

Do you want to insert your Xref object file at insertion point which could be anything instead of 0,0.......Correct???

Posted

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)
)

Posted

thanx pBe

thanks Lee

But I have to run the lisp every time i open or close the file

Posted
But I have to run the lisp every time i open or close the file

 

Load & run it from your ACADDOC.lsp

Posted

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.

Posted
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!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...