LISP2LEARN Posted May 24, 2011 Share Posted May 24, 2011 Using Lee's ObjectDBX. How can I turn on/off layers on the xref? If it is possible... I need to turn on/off layers on our electrical plot sheets which is around 100 drawings. We use model space for our plot sheet and everything is xref in. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 24, 2011 Share Posted May 24, 2011 (vl-load-com) ... [color=green];;<-- Open dbxDoc[/color] (vlax-for oLayer (vla-get-layers dbxDoc) (if (vl-string-search "|" (vla-get-name oLayer)) (vl-put-layeron oLayer :vlax-true)) [color=green];<-- Change to :vlax-false to turn off[/color] ) ... [edit] I just re-read your post, and saw you inquired about on/off, and not freeze/thaw. Code corrected [/edit] Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 24, 2011 Share Posted May 24, 2011 I'm not sure of his construct, but I'm sure he gives you the document to work with, so you could use an example like the following: ((lambda (doc) (vlax-for layer (vla-get-layers doc) (if (wcmatch (vla-get-name layer) "*|*") (vla-put-layeron layer :vlax-false) ) ) ) (vla-get-activedocument (vlax-get-acad-object)) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 24, 2011 Share Posted May 24, 2011 Oops, didn't realize I was late to the ball. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 24, 2011 Share Posted May 24, 2011 I'm not sure of his construct, but I'm sure he gives you the document to work with ... Absolutely right @ LISP2LEARN Supply the ODBX subfunction with the lambda function from Alan's example and it should work. For reference, here is the code being referred to: http://lee-mac.com/odbxbase.html Quote Link to comment Share on other sites More sharing options...
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.