Mostly Nice Posted May 17, 2011 Posted May 17, 2011 Gents, I've been using Lee Mac's LayerDirector.lsp and am very impressed. It got me thinking, can it be modified to also assign XREF's layer names and prompt for a LAYLCK - yes/no? Has anyone investigated this or used something similar? It'd save me a fortune of time correcting the subbies drawings when they dont give Xref's independant layers Nice, Mostly. Quote
irneb Posted May 17, 2011 Posted May 17, 2011 Do you mean you want to insert the xref onto a specific layer? I'm sure it's possible. Modify the *LayerData* list at the start of the routine to include something like this: ("XATTACH" "XREFS" 7) If you mean you want to "cleanup" the layers inside the xref to match the same idea, then a bit different code would be necessary (one which steps through all entities and changes them to the required layer). Quote
Mostly Nice Posted May 17, 2011 Author Posted May 17, 2011 Ha! I feared it was not that simple. Would there be much more involvement if i wanted the layer name to reflect that of the XREF name, with a prefix i.e Z_XREF_Drawing1.dwg And upon attaching the xref, prompts me for a locking option? Quote
BlackBox Posted May 17, 2011 Posted May 17, 2011 Not quite sure if this is what you're after, however, I use a combination of an XREF-Check function, and a small contingent of Command Reactors to manage my XREFs. The XREF-Check function is run when a drawing is opened (ACADDOC.lsp), and steps through a selection of all blocks, and filters for XREFs, then checks to make sure they're placed on the correct layer (aptly named "XREF")... this function also includes a Layer-Check, and makes the "XREF" layer if not already present. The Command Reactors (using :vlr-CommandWillStart event) simply change the active layer to "XREF" prior to executing commands such as XATTACH, XREF, etc. then switches the layer back (:vlr-CommandEnded *Cancelled *Failed). If that sounds helpful, I could post some of my code (it could probably use some updating)...? Quote
Mostly Nice Posted May 17, 2011 Author Posted May 17, 2011 Our interanl checker picks that up thanks, renderdude! but thanks for the input! I think with the LayerDirector.lsp i can add the bits i mentioned above, just not sure how to achieve the right layernames based on the XREF im attaching. There, i begin to swim out of my depth. Quote
alanjt Posted May 17, 2011 Posted May 17, 2011 http://www.cadtutor.net/forum/showthread.php?47349-XRefsToLayers.LSP-Move-XRefs-to-corresponding-layers&p=321369#post321369 EDIT: had to actually add the code to the thread. Quote
woodman78 Posted May 18, 2011 Posted May 18, 2011 Is it possible to make this into a reactor? That will put the xrefs on layers made up of file name? Quote
BlackBox Posted May 18, 2011 Posted May 18, 2011 Is it possible to make this into a reactor? That will put the xrefs on layers made up of file name? Technically you *shouldn't* incorporate user prompts in a reactor, but I'm confident that without the included initget call in XrefsToLayers an adaptation could be written which would function as a reactor's Callback Function. Note - Hopefully I've not overlooked something in XrefsToLayers.lsp, as I skimmed it on my MacBook's TextEdit app, and not VLIDE. Quote
Recommended Posts
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.