Custom XREF's Manager
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Custom XREF's Manager

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
masterbike360
Guest





Posted: Wed Jan 12, 2005 5:37 pm    Post subject: Custom XREF's Manager Reply with quote

We are working on a project that included more than 50 main dwg. Everything is drawn in 3D. We seperate all those 50 files cause the main model was to big (long to open...) We still have a good year and a half before the end of this project.
My question is: Any one as created in the past or work on something to insert (XREF) predefine drawing location.
I'm looking to a dialog box with radio button (at least). You select wich part of the model you want to load. He also look an mark in this dialog box if certain drawing are loaded...

Any idea???
thaks, Simon

Back to top
Alan Henderson @ A'cad So
Guest





Posted: Wed Jan 12, 2005 5:37 pm    Post subject: Re: Custom XREF's Manager Reply with quote

Here is a program I use to xref drawings from the AutoCAD Startin: folder

Save following section as a LISP file -
;XR = set layer to 0 and start NEW xref command
(defun C:XR ()
(command "_LAYER" "T" "0" "S" "0" "")
;--get data and check------------
(defun xr_close_ok ()
(setq XREF (get_tile "XREF"))
(setq XR_VALUES_OK T)
(done_dialog 1)
)
;--cancel input-------------------
(defun xr_cancel_ok ()
(done_dialog 0)
(setq XR_VALUES_OK T)
)
;--get list of all drawings in AutoCAD startin folder
(setq LIT (vl-directory-files (getvar "DWGPREFIX") "*.dwg"))
(setq LIT (vl-sort LIT '<))

;--start dialog box------------------
(setq XR_VALUES_OK nil)
(while (not XR_VALUES_OK)
(setq DCL_XR_ID (load_dialog "Xref.dcl"))
(if (not (new_dialog "Xref" DCL_XR_ID))
(exit)
(progn
(start_list "XREF")
(mapcar 'add_list LIT)
(end_list)
(action_tile "accept" "(xr_close_ok)")
(action_tile "cancel" "(xr_cancel_ok)")
;--start dialog box-----------------
(setq DCL_XR_EXIT (start_dialog))
)
)
;--Unload DCL from memory----------------
(unload_dialog DCL_XR_ID)
)
;--Check of OK Exit------------------------
(if (= DCL_XR_EXIT 1)
(progn
;--get drawing name(s) selected--------
(setq LIST_TEXT nil)
(setq KKS 1 KKF 0 KKK 1 KKL (strlen XREF))
(while (<= KKK KKL)
(if (= (substr XREF KKK 1) " ")
(progn
(setq LIST_TEXT (append LIST_TEXT (list (substr XREF KKS (- KKK
KKS)))))
(setq KKS (1+ KKK))
)
)
(setq KKK (1+ KKK))
)
(setq LIST_TEXT (append LIST_TEXT (list (substr XREF KKS))))
(foreach XXX LIST_TEXT
(setq TXREF (nth (atoi XXX) LIT))
(if (tblsearch "BLOCK" (substr TXREF 1 (- (strlen TXREF) 4)))
(princ (strcat "\n" TXREF " is all ready an XREF in drawing."))
(progn
(princ (strcat "\nXREF drawing..." TXREF))
(command "_XREF" "A" TXREF "0,0" "" "" "")
)
)
)
(princ "\nFinished Xref'ing drawings.")
(princ)
)
(princ "\nXref drawings Cancelled..")
)
(setq xr_close_ok nil xr_cancel_ok nil XREF nil LIT nil XR_VALUES_OK nil
DCL_XR_ID nil)
(setq DCL_XR_EXIT nil LIST_TEXT nil KKS nil KKF nil KKK nil KKL nil TXREF
nil)
(princ)
)

Save following as "Xref.dcl" in same folder as previous lisp file
Xref : dialog {
label = "Insert Xref";
: row {
: column {
label = "Select Xref Drawing to Insert";
: text {
label = "Hold <CTRL> key to select multiple drawings to Xref";
}
: list_box {
key = "XREF";
multiple_select = true;
fixed_height = true;
fixed_width = false;
width = 50;
height = 30;
allow_accept=true;
}
}
}
ok_cancel;
}
Back to top
j buzbee
Guest





Posted: Wed Jan 12, 2005 7:24 pm    Post subject: Re: Custom XREF's Manager Reply with quote

As far as the insertion part of your problem: 0,0,0.

It might seem odd at first, but believe me it makes everyones life easier;
even if you have objects hundreds of feet away from the origin.

I do this with large projects at it works flawlessly. If you buy into the
origin concept then the xref manager will handle your other concerns. If
not, I'm sure someone will come along to sell you something soon ;-)

just my 0.02USD

jb

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB