View Full Version : Xref's
pinkguju
26th Oct 2010, 09:33 pm
So i have a script i've written where autocad will open a specified file, execute a bunch of commands then create a dxf out.
Before it starts executing commands i would like it to select all external refrences and move it to a specific layer.
i tried "(ssget "X" '((0 . "block reference")))" as well as "(ssget "X" '((0 . "EXTERNAL REFERENCE")))"
nothing seems ot be working....
any ideas?
lpseifert
26th Oct 2010, 09:53 pm
Maybe this will work for ya... very little testing
(vl-load-com)
(setq ss (ssget "_X" '((0 . "INSERT")))
idx -1
)
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss (setq idx (1+ idx)))))
(if
(vlax-property-available-p obj 'Path)
(vlax-put obj 'Layer "LayerName")
)
)
pinkguju
26th Oct 2010, 10:29 pm
So it has to fit in the below script. Ideally it would be done at the beginning, right after the zoom/extents.
open
"f:/Retail_Focus/Retail_Focus_Data/Retail_Focus_Stores/DPatel/Tests/DXF 1/1004 Test L1.dwg"
.ZOOM
E
.layer T 0 T A350* T "BORDER INFORMATION" T AISLE* T CONST* T CORNICE T ELEC* T NOTE T "PLOT SHADE*" T FIX* T SEARS* T TAPE* T WIPEOUT T BCB* T ARCH* T DIV* T DEPT* ON 0 ON A350* ON "BORDER INFORMATION" ON AISLE* ON CONST* ON CORNICE ON ELEC* ON NOTE ON "PLOT SHADE*" ON FIX* ON SEARS* ON TAPE* ON WIPEOUT ON BCB* ON ARCH* ON DIV* ON DEPT*
.XREF B ****
.layer LO "*####*" LO "AISLE DEFINITION" LO TAPE* LO DIV* LO DEPT*
ERASE
ALL
.PURGE ALL * N
.REGENALL
.DXFOUT "K:/KmartApplications/Intactix/ProFloor/current_dxf/1004 L1.DXF" 3
.close
y
pinkguju
26th Oct 2010, 10:30 pm
I tried what you gave me, lpseifert, but i got either a "nil" or a "(_> )" at the end.
lpseifert
26th Oct 2010, 10:37 pm
If you've inserted the code in your script file, I would suggest you debug it to find where the error is.
If you're entering the code at the command line and you're getting "(_> )" try hitting enter.
If you're getting "nil" it probably worked; check the xrefs and see if the layer changed.
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.