Jump to content

How to get existing layerfilters


EnM4st3r

Recommended Posts

Hi, 

 

does anyone know how to get a list of all Layerfilters in the document?
I want to create a new Filter but if that filter already exists i want to add the layers to that filter instead of creating a new one.

Thats the line im using to create the filter:

(command "_.-layer" "_filter" "_new" "_group" "" (apply 'strcat (mapcar '(lambda (x) (strcat x ",")) laylist)) filtername "")

 

Link to comment
Share on other sites

(setq xdict (vlax-vla-object->ename
	      (vla-getextensiondictionary
		(vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
	      )
	    )
)
(vl-remove-if '(lambda (x) (/= 3 (car x))) (dictsearch xdict "ACAD_LAYERFILTERS"))

 

Link to comment
Share on other sites

hmm, somehow my layerfilters doesnt seem to be saved in there.

 

  (setq xdict (vla-getextensiondictionary (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))))
  (vlax-dump-object (vla-item xdict "ACAD_LAYERFILTERS") t)

 

this gives me Count 0 even tough there are layerfilters

 


image.thumb.png.89ddc2427c02f98a10e18afcb969e37c.png

Link to comment
Share on other sites

oh, found a function of Lee Mac that does exactly what i want.

 

  • Like 2
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...