Results 1 to 6 of 6

Thread: Xref insertion points

  1. #1
    Member kieren's Avatar
    Join Date
    2003-04
    Location
    Stafford, UK
    Posts
    34
    Login to Give a bone
    0

    Unhappy Xref insertion points

    Complete brain freeze here!

    Anyone know how I can just select an already inserted xref and change its values so that the insertion point is 0,0 and its rotation is 0 degrees?

    Got a drawing with lots of xrefs attached but for some reason have been moved and rotated. I need to get them back to original co-ords. Don't fancy reloading all as this will change my layer state.

    Thanks.

  2. #2
    Member
    Join Date
    2004-05
    Posts
    3
    Login to Give a bone
    0

    Default Re: Xref insertion points

    Kieren,
    Just use properties and change the x and y and rotation there. That way layers and settings for the xrefs stay the same.

  3. #3
    Member kieren's Avatar
    Join Date
    2003-04
    Location
    Stafford, UK
    Posts
    34
    Login to Give a bone
    0

    Default Re: Xref insertion points

    Yeah, thought of that, but I have multiple xrefs in each model, and wanted to try and change by just "picking" the xref !! ??

  4. #4
    100 Club
    Join Date
    2000-12
    Posts
    126
    Login to Give a bone
    0

    Default Re: Xref insertion points

    Here's just a quick and basic one (you can insert code to pick an object and get the name to process one at a time if you like).
    Code:
    (defun resetXrefs (/ a b xset ent entl)
      (cond
        ((setq xset (ssget "X" '((0 . "INSERT"))))
         (setq a 0 b 0)
         (repeat (sslength xset)
           (setq ent  (ssname xset a)
                 entl (entget ent)
                 a    (1+ a)
           )
           (cond
             ((>= (cdr (assoc 70 (tblsearch "BLOCK" (cdr (assoc 2 entl))))) 4)
              (setq entl (subst '(10 0.0 0.0 0.0) (assoc 10 entl) entl)
                    entl (subst (cons 50 0.0) (assoc 50 entl) entl)
              )
              (and (entmod entl)(setq b (1+ b)))
             )
           )
         )
        )
      )
      b
    )

  5. #5
    Member kieren's Avatar
    Join Date
    2003-04
    Location
    Stafford, UK
    Posts
    34
    Login to Give a bone
    0

    Default Re: Xref insertion points

    Stig,
    To the rescue again - thanks!
    Works a treat. A question or two though -

    -- does this only work with xrefs, or does it pick up blocks too? (just glancing at code)

    -- does it only pick up xrefs in MS (which is what I need - some of our drawings have xrefs as title block info in PS which I dont want moving)


    Regards,

  6. #6
    100 Club
    Join Date
    2000-12
    Posts
    126
    Login to Give a bone
    0

    Default Re: Xref insertion points

    It assumes that block definitions with a code 70 flag equal to or greater than 4 are xrefs, which is pretty safe as SSGET only grabs main entities. So yes, it'll will only select xrefs.

    To only make it select xrefs in MS, insert an extra filter of (67 . 0), i.e. (ssget "X" '((0 . "INSERT")(67 . 0)))

    To make it exclude certain xrefs, collect the names you want to exclude (or hardcode it) and
    1. insert a filter with code 2 with a negator, e.g. (setq ss (ssget "X" '((0 . "INSERT")(67 . 0)(2 . "~*title*")))) or something like that (check out WCMATCH in the help files to see what is allowed).
    Or 2., just skip the xrefs while in the loop, e.g. (if (not (member this_name list_of_names_to_exclude)))(... proceed ...)

Similar Threads

  1. Replies: 3
    Last Post: 2012-07-12, 03:22 PM
  2. Insertion Points
    By ty_demo15 in forum ACA General
    Replies: 8
    Last Post: 2009-01-06, 12:50 PM
  3. Xref insertion points and scale factors????
    By justinpickens in forum AutoCAD General
    Replies: 4
    Last Post: 2009-01-05, 08:24 AM
  4. insertion points
    By kadar_drafting in forum CAD Standards
    Replies: 9
    Last Post: 2008-02-15, 07:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •