|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2003-04
Location: Stafford, UK
Posts: 34
![]() |
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.
__________________
..:: KIEREN ::.. Structural Draughtsman |
|
|
|
|
|
#2 |
|
Member
Join Date: 2004-05
Posts: 3
![]() |
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 |
|
Member
Join Date: 2003-04
Location: Stafford, UK
Posts: 34
![]() |
Yeah, thought of that, but I have multiple xrefs in each model, and wanted to try and change by just "picking" the xref !! ??
__________________
..:: KIEREN ::.. Structural Draughtsman |
|
|
|
|
|
#4 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 |
|
Member
Join Date: 2003-04
Location: Stafford, UK
Posts: 34
![]() |
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,
__________________
..:: KIEREN ::.. Structural Draughtsman |
|
|
|
|
|
#6 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 ...) |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XREF - orphaned or "Not found" | axa2001ro | VBA | 1 | 2004-06-21 04:42 PM |
| Xref vs Worksets | Wagurto | Revit Architecture - General | 4 | 2004-06-19 03:54 AM |
| Scaling Points in Block | jcronburg | ACA General | 3 | 2004-06-10 07:21 PM |
| Xref file is not loading for some reason... | bjack56 | AutoCAD General | 11 | 2004-06-05 05:18 PM |
| reload xref - layers | kca2.69080 | ACA General | 2 | 2004-06-02 11:44 PM |