Jump to content

Could really use some ssget lisp help, please


Recommended Posts

Hi all,

 

I'm hoping someone who knows lisp and object codes could help me convert the attached filter setup into a ssget lisp, so I can call it on the command line, please!

 

I've been looking at this thread, but I can't puzzle my way through it so far. My lisp skills are terrible to nonexistent!

http://www.cadtutor.net/forum/showthread.php?21217-FILTER-Command

 

I've attached a screenshot of the filter setup, and here's a clip from the filter.nfl file, if that's more helpful:

 

FilterSetup.jpg

 

(-4 . "

(1 . "ose to any third party.")

(1 . "3510")

(-4 . "=")

(62 . 166)

(-4 . "=")

(62 . 72)

(-4 . "=")

(62 . 251)

(2 . "attr2-edit")

(-4 . "

(8 . "Paper Text")

(0 . "*POLYLINE")

(-4 . "AND>")

(-4 . "OR>")

:ai_str|PG

** Begin OR

Text Value = ose to any third party.

Text Value = 3510

Color = Color

Color = Color

Color = Color

Block Name = attr2-edit

** Begin AND

Layer = Paper Text

Object = Polyline

** End AND

** End OR

 

Thanks so much for the help...this will save me a ton of repetitive grind time!

Link to comment
Share on other sites

Not to take away from the LISP routine you're after, but you can save Filter Selections for future use. Didn't know if this would be good enough for your needs or not, although to be able to start a LISP routine directly from the Command Line would save a step.

Link to comment
Share on other sites

Thanks for the thought, StykFacE.

 

I do have it saved, but since I can't manipulate the Filter dialog from the command line once it starts, I'd much rather type a command alias and let 'er rip. I do this A LOT... It's set up to select our old titleblock as I convert to the new, improved one I made for us.

Link to comment
Share on other sites

Try this...

 

(defun c:FOO  ()
 (sssetfirst
   nil
   (ssget "_x"
          '((-4 . "<OR")
            (1 . "ose to any third party.")
            (1 . "3510")
            (-4 . "=")
            (62 . 166)
            (-4 . "=")
            (62 . 72)
            (-4 . "=")
            (62 . 251)
            (2 . "attr2-edit")
            (-4 . "<AND")
            (8 . "Paper Text")
            (0 . "*POLYLINE")
            (-4 . "AND>")
            (-4 . "OR>"))))
 (princ))

Link to comment
Share on other sites

Thanks for the code RenderMan!

 

I tried it, and it works perfectly. The only part I'm not getting is that it runs when I load it, but I can't call it again as a commmand...is it something I'm doing, or is the code missing something that sets that up? It looks pretty normal to my mostly untrained eye in terms of the defun.

 

Thanks for the help!

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