xdata

Discussion in 'AutoCAD' started by agruno, May 13, 2004.

  1. agruno

    agruno Guest

    Hi
    I write code to add xdata for autocad objects.
    but if I want to select objects using - ssget filter is xdata
    Cad selects only polylines.
    Many thanks for help

    code:

    (defun add_xdata ()
    (setq m (ssget))
    (setq len (sslength m))
    (setq mm (regapp (strcat "jooneke_" (rand_string))))
    (setq xlist (list (list -3 (list mm '(1000 . "kallakujoon")))))
    (setq i 0)
    (repeat len
    (setq rida (entget (ssname m i)))
    (setq rida (append rida xlist))
    (entmod rida)
    (setq i (+ 1 i))
    )
    )

    (defun c:kustutajooned ()
    (setq kustutus (entget(car(entsel)) '("*")))
    (setq xdata (assoc -3 kustutus))
    (setq joonkustutus (ssget (list xdata)))
    (command "Erase" joonkustutus "")
    )


    (defun rand_string ()
    (setq systime (getvar "cdate"))
    (setq sysint (fix systime))
    (setq sysvahe (- systime sysint))
    (setq sysvahe (* 1000000.000 sysvahe))
    (setq random (rtos (abs (- sysint sysvahe)) 2 0))
    random
    )
     
    agruno, May 13, 2004
    #1
  2. agruno

    bob.at Guest

    Curious. I cant find that anything is wrong. It seems to work for polylines, splines; maybe all element with more than one control point group 10, but not for others like text, circle, line.
    (Tested in 2002 and 2004)

    The only way i see is to select all without your "xdata" list as filter an than step through all elements doing the test manually

    bob.at
     
    bob.at, May 13, 2004
    #2
  3. (defun c:kustutajooned (/ ss)
    (setq ss (ssget "X" '((-3 ("*")))))
    (command "._Erase" ss "")
    (princ))

    --
    R. Robert Bell


    Hi
    I write code to add xdata for autocad objects.
    but if I want to select objects using - ssget filter is xdata
    Cad selects only polylines.
    Many thanks for help

    code:

    (defun add_xdata ()
    (setq m (ssget))
    (setq len (sslength m))
    (setq mm (regapp (strcat "jooneke_" (rand_string))))
    (setq xlist (list (list -3 (list mm '(1000 . "kallakujoon")))))
    (setq i 0)
    (repeat len
    (setq rida (entget (ssname m i)))
    (setq rida (append rida xlist))
    (entmod rida)
    (setq i (+ 1 i))
    )
    )

    (defun c:kustutajooned ()
    (setq kustutus (entget(car(entsel)) '("*")))
    (setq xdata (assoc -3 kustutus))
    (setq joonkustutus (ssget (list xdata)))
    (command "Erase" joonkustutus "")
    )


    (defun rand_string ()
    (setq systime (getvar "cdate"))
    (setq sysint (fix systime))
    (setq sysvahe (- systime sysint))
    (setq sysvahe (* 1000000.000 sysvahe))
    (setq random (rtos (abs (- sysint sysvahe)) 2 0))
    random
    )
     
    R. Robert Bell, May 14, 2004
    #3
  4. agruno

    Jürg Menzi Guest

    agruno

    (ssget "_X" '((-3 ("jooneke_*"))))

    Cheers
     
    Jürg Menzi, May 14, 2004
    #4
  5. (Guess I should have gotten a bit more specific, eh? <g>)

    --
    R. Robert Bell


    agruno

    (ssget "_X" '((-3 ("jooneke_*"))))
     
    R. Robert Bell, May 14, 2004
    #5
  6. agruno

    Jürg Menzi Guest

    Robert

    It's probable... <VBG>

    Cheers
     
    Jürg Menzi, May 14, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.