Author Topic: Why do I get an nil for the 2nd item in the selection set?  (Read 1394 times)

0 Members and 1 Guest are viewing this topic.

psuchewinner

  • Guest
Why do I get an nil for the 2nd item in the selection set?
« on: July 17, 2010, 09:19:12 AM »
Why do I get an nil for the 2nd item in the selection set?

(setq textset (ssget))
(setq TextObject (vlax-ename->vla-object (ssname textobjectSet 0)))
(setq TextObject (vlax-ename->vla-object (ssname textobjectSet 1)))

I even tried releasing the object before i tried it for position "1" and that did not seem to be the solution.


Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Why do I get an nil for the 2nd item in the selection set?
« Reply #1 on: July 17, 2010, 09:49:59 AM »
Code: [Select]
(setq [color=red]textset[/color] (ssget))
(setq TextObject (vlax-ename->vla-object (ssname [color=red]textobjectSet[/color] 0)))
(setq TextObject (vlax-ename->vla-object (ssname [color=red]textobjectSet[/color] 1)))

I don't know how to deal with vlax..... but in your codes the selection set group has to get the same
name to get the selection.

Regards

Tharwat

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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.

ozimad

  • Guest
Re: Why do I get an nil for the 2nd item in the selection set?
« Reply #3 on: July 19, 2010, 03:45:40 AM »
(defun c:test0 ()
    (vl-load-com)
    (setq textset (ssget))
    (print (setq TextObject1 (vlax-ename->vla-object (ssname textset 0))))
    (print (setq TextObject2 (vlax-ename->vla-object (ssname textset 1))))
    (princ)
)

psuchewinner

  • Guest
Re: Why do I get an nil for the 2nd item in the selection set?
« Reply #4 on: July 19, 2010, 07:16:31 AM »
Thanks guys but for some statnge reason it is working fine.  I must have fat fingered something.