Attaching more than one xref
Comments
-
ANYONE???0
-
i did not try it, but this seems to be possible:
"I decided the best way to ADD / DETACH / UNLOAD / RELOAD xref drawings is to do it manually. Using NOTEPAD I created a LSP file and simplay APPLOAD each drawing I opened, one by one....APPLOAD the LSP...and...got it done.
Added the info within the { and } symbols.
(setvar "ctab" "Model")
(COMMAND "-layer" "SET" "{XREF_LAYER}" "")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "DETACH" "{FILE_NAME} ")
(COMMAND "-XREF" "UNLOAD" "{FILE_NAME} ")
(COMMAND "-XREF" "RELOAD" "{FILE_NAME} ")
Changed the layer colors too...why not...examples:
(command "-layer" "freeze" "*UTIL-N_RECORD*" "")
(command "-layer" "thaw" "UTIL-N_RECORD|*U-ELEC*" "")
(command "-layer" "color" "8" "UTIL-N_RECORD|*U-ELEC*" "")That's the best I can do....oh well..."
Apparently this program can also do that: http://www.dotsoft.com/toolpac.htm
0 -
i made an Tool for you. you need the OpenDCL Runtime. You can get it here: http://www.opendcl.com/download/
The tool is very simple. you select the Files you want to attach and the Files are attached on the actualy Layer on 0.0.0.
The drawingorder of the files is Bottom.
Martin0 -
benjamin schlanz This is for adding multiple xref to multiple dwg. I need Multiple xref to one dwg...Martin Drese Can you explain a little more your way? I have installed OpenDCL Runtime. What now?0
-
the code is for adding files to ONE dwg.
just copy and change the line "(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0") " to be the dwg path to your xrefs. do this 48 times. and than start the lisp.
try it like this:
[code]
(defun c:xrefattachmultiple ()
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(COMMAND "-XREF" "OVERLAY" "{DRIVE_LETTER:\\FOLDER_NAME\\FILE_NAME.DWG}" "0,0,0" "1" "1" "0")
(princ)
)
[/code]
As for martins code: as soon as you have opendcl installed be sure to restart your computer and bricscad. Opendcl should load automatically, so all you have to do is load martins file with "_appload" and start it.
If he tells you that opendcl is not installed try to install the latest stable build instead of current build.0 -
Hi,See pic 1 and 2. Still Not working...where am I doing wrong?Sorry for bothering1(2).jpg2(2).jpg0
-
you are in the wrong dialog. when you "apploaded" the lisp type: XattachMulti in the command line
see picture.2.png0 -
ok. I got error..pic 33.jpg0
-
which version did you download? studio or runtime? have you restarted your computer?
I am only using bricscad v16 and i had problems with the "current" build, the "stable" build works fine for me.
Not sure about V17.
Maybe somebody else can help.
cheers0 -
I have downloaded OpenDCL.Runtime.8.0.1.0, yes i have restarted computer.I am using BricsCAD Version 17.1.17 (x64) revision 467040
-
if your BricsCAD Version is an Classic one and not Pro or Platinum - you are in big shit :-(
But if you are on Pro or Platinum what happend if you type in: opendcl0 -
@Marko:
IMO you are exaggerating in your original post. The job should take 24 minutes or less even for an inexperienced CAD operator.
But anyway... The code below should work with BricsCAD V16 and above out-of-the-box. For earlier versions installing DOSLib is required.
[code](defun c:InsXrefs ( / lst pt1 pt2 vec)
(if
(and
(setq lst
(dos_getfilem
"Select Drawings"
(cond
(*InsXrefsPath*)
((= 1 (getvar 'dwgtitled))
(getvar 'dwgprefix)
)
("")
)
"Drawing File (*.dwg)|*.dwg||"
)
)
(setq pt1 (getpoint "\nInsertion point: "))
(or
(setq pt2 (getpoint pt1 "\nPoint for spacing or Enter: "))
T
)
)
(progn
(setvar 'cmdecho 0)
(setq vec (if pt2 (mapcar '- pt2 pt1) '(0.0 0.0 0.0)))
(setq *InsXrefsPath* (car lst))
(foreach dwg (cdr lst)
(command "_.-xref" "_attach" (strcat *InsXrefsPath* dwg) pt1 "_xyz" 1.0 1.0 1.0 0.0)
(setq pt1 (mapcar '+ pt1 vec))
)
(setvar 'cmdecho 1)
)
)
(princ)
)[/code]0 -
Improved code below (Added: undo stuff "_non"):
[code](defun c:InsXrefs ( / doc lst pt1 pt2 vec)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vla-endundomark doc)
(vla-startundomark doc)
(if
(and
(setq lst
(dos_getfilem
"Select Drawings"
(cond
(*InsXrefsPath*)
((= 1 (getvar 'dwgtitled))
(getvar 'dwgprefix)
)
("")
)
"Drawing File (*.dwg)|*.dwg||"
)
)
(setq pt1 (getpoint "\nInsertion point: "))
(or
(setq pt2 (getpoint pt1 "\nPoint for spacing or Enter: "))
T
)
)
(progn
(setvar 'cmdecho 0)
(setq vec (if pt2 (mapcar '- pt2 pt1) '(0.0 0.0 0.0)))
(setq *InsXrefsPath* (car lst))
(foreach dwg (cdr lst)
(command "_.-xref" "_attach" (strcat *InsXrefsPath* dwg) "_non" pt1 "_xyz" 1.0 1.0 1.0 0.0)
(setq pt1 (mapcar '+ pt1 vec))
)
(setvar 'cmdecho 1)
)
)
(vla-endundomark doc)
(princ)
)[/code]0