Author Topic: ssget with Handles as filter  (Read 3505 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Guest
ssget with Handles as filter
« on: November 25, 2005, 06:51:59 AM »
Hello everybody,

For my animation program I store some “scenes” in a dictionary. So I can record them later. (Since rendering takes time this will be at night). To make the whole thing president, (I mean I want to be able to record a scene I defined in an earlier acad session) I store the handles of the entities involved in the scene in a list in the dictionary.

But
Code: [Select]
   (ssget "X" (list (cons 5 x)))
 

returns nil.

Can’t I ssget on Handles? So do I have to run trough a wider ssget selection and than check every en for the right handle?

Tia,

Bernd





Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ssget with Handles as filter
« Reply #1 on: November 25, 2005, 07:24:33 AM »
Since you have the handles available,
the Lisp function HANDENT Returns an object (entity) name based on its handle.

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.

SMadsen

  • Guest
Re: ssget with Handles as filter
« Reply #2 on: November 25, 2005, 08:44:39 AM »
If you're using Dictionaries, why not store the entity names? Then if you want to build a selection set, you'll just use SSADD.

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: ssget with Handles as filter
« Reply #3 on: November 25, 2005, 10:04:23 AM »
In addition to the other answers...
From help:
The ssget function recognizes all group codes except entity names (group –1), handles (group 5), and xdata codes (groups greater than 1000).
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Amsterdammed

  • Guest
Re: ssget with Handles as filter
« Reply #4 on: November 25, 2005, 10:14:10 AM »
Right Juerg,

SMadsen, i thought entities names can change when i reopen the drawing.

Kerry, the handent function was i was overlooking, never worked with handles before. Thanks, i does the trick.

Thanks to all, Bernd

SMadsen

  • Guest
Re: ssget with Handles as filter
« Reply #5 on: November 25, 2005, 11:25:14 AM »
SMadsen, i thought entities names can change when i reopen the drawing.
True, entity names are memory adresses that are assigned when creating the drawing database. But the references within the drawing file remain valid at any time. Otherwise, they'd be useless and wouldn't exist.

For a job like yours, I'd create a Dictionary and populate it with XRecords for each scene and assign entities to a code between 350-359.

Crank

  • Water Moccasin
  • Posts: 1503
Re: ssget with Handles as filter
« Reply #6 on: November 25, 2005, 11:47:52 AM »
Code: [Select]
   (ssget "X" (list (cons 5 x)))
 

returns nil.

Can’t I ssget on Handles? So do I have to run trough a wider ssget selection and than check every en for the right handle?
Remove handle:
Code: [Select]
(defun remhandle (handle / )
   (ssdel (handent handle) (ssget "X"))
)

Get handle:
Code: [Select]
(defun gethandle (handle / )
   (ssadd (handent handle))
)
Vault Professional 2023     +     AEC Collection