Author Topic: why is selectionset name case-sensitive?  (Read 2036 times)

0 Members and 1 Guest are viewing this topic.

FengK

  • Guest
why is selectionset name case-sensitive?
« on: May 05, 2006, 02:26:42 AM »
Seems for every collection in AutoCAD: layer, block, registered appilcations, view, ucs, etc., the name is case-insensitive, but why is selectionset different?  I could not think of any good reason.  Thank you.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: why is selectionset name case-sensitive?
« Reply #1 on: May 05, 2006, 02:29:27 AM »
Can you show an example Kelie ?
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.

FengK

  • Guest
Re: why is selectionset name case-sensitive?
« Reply #2 on: May 05, 2006, 03:48:49 AM »
Thanks Kerry.

Try testing something like this?

Code: [Select]
(setq colSS (vla-get-selectionsets
      (vla-get-activedocument
(vlax-get-acad-object)
      )
    )
)
(setq objSS1 (vla-add colSS "ssA"))
(setq objSS2 (vla-add colSS "ssa"))

(equal objSS1 objSS2) ; -> returns nil.

What did I miss?  I noticed this long time ago.  I just made sure always using uppercase.

<code tags added>
« Last Edit: May 05, 2006, 07:46:18 AM by CAB »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: why is selectionset name case-sensitive?
« Reply #3 on: May 05, 2006, 04:24:14 AM »
You're correct, using ActiveX ..

The best solution is  to use all upper or all lower, as you are doing.

There are a couple of things to watch with string case Using ActiveX ..

Have a try with this one  .. it's a real trap, cause the LayerObjects are reported, but the Layers don't exist in the database.
Code: [Select]
(setq collLayers (vla-get-layers
         (vla-get-activedocument
      (vlax-get-acad-object)
         )
       )
)
(vla-get-count collLayers)
;;-> 1
(setq objLAY1 (vla-add collLayers "LAY1"))
;;-> #<VLA-OBJECT IAcadLayer2 07d391a4>
(setq obLAY2 (vla-add collLayers "lay1"))
;;-> #<VLA-OBJECT IAcadLayer2 07d39134>
(setq obLAY3 (vla-add collLayers "lAy1"))
;;-> #<VLA-OBJECT IAcadLayer2 07d395e4>
(setq obLAY4 (vla-add collLayers "lAY1"))
;;-> #<VLA-OBJECT IAcadLayer2 07d39594>
(vla-get-count collLayers)
;;-> 2

<repaired result of fat fingers>
« Last Edit: May 05, 2006, 09:16:21 PM by Kerry Brown »
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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: why is selectionset name case-sensitive?
« Reply #4 on: May 05, 2006, 05:08:46 AM »
Just to clarify that :

This is the result.
Code: [Select]
(vla-get-Name objLAY1)
;;-> "LAY1"

(vla-get-Name obLAY2)
;;-> "LAY1"

(vla-get-Name obLAY3)
;;-> "LAY1"

(vla-get-Name obLAY4)
;;-> "LAY1"

I'm not going to try to second guess the designers regarding the logic behind the inconsistancy.
 
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.