Jump to content

Xref's


pinkguju

Recommended Posts

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?

Link to comment
Share on other sites

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 "[color=red][i]LayerName[/i][/color]")
   )
 )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Edited by lpseifert
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...