Jump to content
plackowski

Object selection filter not finding block

Recommended Posts

plackowski

I've attached two drawings, each containing almost identical blocks named REVBLK. In one case, the test function below finds the block. In the other case, it does not. Why?

 

Some context - I modified our REVBLK a few weeks ago, condensing the attributes so the revision block will fit in a smaller space. My lisp routine to update the title block can no longer locate the revised REVBLK.

(defun _TestFunction (  /  )

	(setq rbname "REVBLK")
	(setq ss (ssget "_X" (list (cons 2 rbname)))) 
	(if ss
		(princ "testfunction found revblk")
		(princ "no revblks found")
	)
)

 

blockfound.dwg noblockfound.dwg

Share this post


Link to post
Share on other sites
Tharwat

Hi,

You block must be dynamic and that's why ssget function can't select it  / them.

So you need to iterate though the selection set and check if the name of the block is your target one and the following should allow you to select them.

 (cons 2 (strcat "`*U*," rbname))

 

  • Thanks 1

Share this post


Link to post
Share on other sites
plackowski

Awesome thank you!

 

Unfortunately, I did not intend to make the block dynamic, and I'm not sure what I did that caused it. It also looks like there are no easy ways to convert it back without recreating it from the original block again...

 

Edit: That was much easier than I thought. I had added a Basepoint Parameter unnecessarily. Deleting it converted it back. 

Edited by plackowski

Share this post


Link to post
Share on other sites
Tharwat

If so, then just dive into the block editor and delete any dynamic parameter then save and close the editor and that should solve it back to its original normal structure. ;) 

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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