Jump to content

Turn on/off Xref layers


LISP2LEARN

Recommended Posts

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.

Link to comment
Share on other sites

(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]

Link to comment
Share on other sites

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))
)

Link to comment
Share on other sites

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

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...