Author Topic: Problem with attribute matching  (Read 5335 times)

0 Members and 1 Guest are viewing this topic.

drumbald

  • Guest
Problem with attribute matching
« on: December 07, 2005, 05:20:04 PM »
This will match individual attributes text. I want to change it to match all the text in a block not individual ones

 

Code: [Select]
(defunct C:MTB ( / SOURCE TEXT DEST)

(while (not (and

  (prince "\please Select Source Title Block ")

  (set SOURCE (car (nettle)))

    (if

      (OR

        (= (car (assoc 0 (entreat SOURCE))) "ATTRIB")

        (= (car (assoc 0 (entreat SOURCE))) "TEXT")

        (= (car (assoc 0 (entreat SOURCE))) "MTEXT")

      )

      (prong 

       (set TEXT (car (assoc 1 (entreat SOURCE))))

       (prince (strata "\please Select Source Text (Attribute or Text) " TEXT))

       (prince "\please Select Text to Change (Attribute or Text) ")

       (set DEST (car (nettle)))

       (if (OR

                 (= (car (assoc 0 (entreat DEST))) "ATTRIB")

                 (= (car (assoc 0 (entreat DEST))) "TEXT")

                 (= (car (assoc 0 (entreat DEST))) "MTEXT")

                 )

             (prong     

                   (set DEST (entreat DEST))

                   (set DEST

                             (subset (cons 1 TEXT)

                                        (assoc 1 DEST)

                                        DEST

                         ) ; subset

                   ) ; set

                   (entomb DEST)

                   (endued (car (assoc -1 DEST)))

              ) ; prong

             (prince "\must be either an Attribute or Text!")

        ) ; if

       

       (prince)

    ) ; prong

    (prong

       (prince "\entity must be an Attribute or Text object!")

       (prince)

    ) ; prong

 

  ) ; if

))) ;whike,and,or

  (alert "This Lisp program was \nwritten by Craig Petersen \nThis is shareware:")

(prince)

   

) ; defunct



Code Tags added by CAB
« Last Edit: December 07, 2005, 05:24:20 PM by CAB »

deegeecees

  • Guest
Re: Problem with attribute matching
« Reply #1 on: December 07, 2005, 05:21:06 PM »
Please elaborate.

whdjr

  • Guest
Re: Problem with attribute matching
« Reply #2 on: December 07, 2005, 05:25:56 PM »
Try this MatchAtts.lsp

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Problem with attribute matching
« Reply #3 on: December 07, 2005, 05:40:49 PM »
drumbald -

if the posted code is not yours please remove it. We don't want any problems with the author. this is the part that bothers me.
Code: [Select]
"This Lisp program was \nwritten by Craig Petersen \nThis is shareware:"
Thanks.
TheSwamp.org  (serving the CAD community since 2003)

LE

  • Guest
Re: Problem with attribute matching
« Reply #4 on: December 07, 2005, 05:45:10 PM »
What language is that for the functions names..... ?

deegeecees

  • Guest
Re: Problem with attribute matching
« Reply #5 on: December 07, 2005, 05:52:46 PM »
I was having the same ???'s LE, other than the fact that people just spurt out a little sentence and expect others to just jump at it. I know its a learning thing, mixed with an ego thing, but come on, what dahells that all about!? </rant off>

Ok, Mr. Drumbald, if you get back to this please revise your code like Mr. Thomas said, or it will be removed.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Problem with attribute matching
« Reply #6 on: December 07, 2005, 05:57:02 PM »
guys,

this is what happens when peeps use obscure nick names.

Have a look at the posters email address ..
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Bob Wahr

  • Guest
Re: Problem with attribute matching
« Reply #7 on: December 07, 2005, 06:10:04 PM »
Eyes like an eagle (or is that an e-gull)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Problem with attribute matching
« Reply #8 on: December 07, 2005, 06:15:40 PM »
Heh, bob,

Someone who uses the undocumented defunct function can't be all bad. :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Serge J. Gianolla

  • Guest
Re: Problem with attribute matching
« Reply #9 on: December 07, 2005, 06:15:57 PM »
This maybe LISP but not Auto or Visual, I think that's what Luis meant DGC. :angel:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Problem with attribute matching
« Reply #10 on: December 07, 2005, 06:21:26 PM »
Here is a translation.
Code: [Select]
(defun c:mtb (/ source text dest)
  (while
    (not
      (and
        (setq source (car (entsel "\nplease Select Source Title Block ")))

        (if (member (cdr (assoc 0 (entget source))) '("ATTRIB" "TEXT" "MTEXT"))
          (progn
            (setq text (cdr (assoc 1 (entget source))))
            (prompt
              (strcat "\please Select Source Text (Attribute or Text) " text)
            )

            (setq dest
                   (car (entsel
                          "\nplease Select Text to Change (Attribute or Text) "
                        )
                   )
            )

            (if
              (member (cdr (assoc 0 (entget dest))) '("ATTRIB" "TEXT" "MTEXT"))
               (progn
                 (setq dest (entget dest))
                 (setq dest (subst (cons 1 text) (assoc 1 dest) dest))
                 (entmod dest)
                 (entupd (cdr (assoc -1 dest)))
               )
               (prompt "\nmust be either an Attribute or Text!")
            )
          )

          (prompt "\nentity must be an Attribute or Text object!")

        )

      )
    )
  ) ; while

  (prompt
    "This Lisp program was \nwritten by Craig Petersen \nThis is shareware:"
  )

  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Problem with attribute matching
« Reply #11 on: December 07, 2005, 06:26:14 PM »
Well, that ruins my theory. I thought he was a guy from Portland or  Anaheim having some fun.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Serge J. Gianolla

  • Guest
Re: Problem with attribute matching
« Reply #12 on: December 07, 2005, 06:33:09 PM »
Very good Alan, you are now officially bilingual! :kewl:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Problem with attribute matching
« Reply #13 on: December 07, 2005, 06:38:57 PM »
Well, that ruins my theory. I thought he was a guy from Portland or  Anaheim having some fun.
Not so fast, I think you may be correct. :-)

That is my (goofing around) translation of the routine not an official translation.
Sorry Serge, I wish it were so. :-(
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Problem with attribute matching
« Reply #14 on: December 07, 2005, 08:04:06 PM »
prong !!??

you mean..

progn !!



prince !!??

you mean

princ !!

or maybe...princesse !![/color]

same with...

entreat...nettle...entomb..endued !!!

maybe this was wrote in another language..
« Last Edit: December 07, 2005, 08:10:57 PM by Andrea »
Keep smile...