Author Topic: Lower case XREF name  (Read 2364 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7533
Lower case XREF name
« on: January 12, 2006, 11:46:36 AM »
Why will the paths change to lowercase but the name won't?


Code: [Select]
(defun c:xrlcase (/ sl index ent OBJ)
  (if (setq sl (ssget "_X"
      '((0 . "INSERT"))
       )
      )
    (progn
      (setq index -1)
      (while (< (setq index (1+ index)) (sslength sl))
(setq ent (ssname sl index)
      OBJ (vlax-ename->vla-object ent)
)
(if (vlax-property-available-p OBJ 'Path)
  (progn
    (vla-put-path obj (strcase (vla-get-path obj) T))
    (vla-put-name obj (strcase (vla-get-name obj) T))
  )
)
      )
    )
  )
)

Thanks,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Re: Lower case XREF name
« Reply #1 on: January 12, 2006, 11:54:26 AM »
Because the name is set in the Blocks collection.....change your (if to this and add blk to your local variables declarations:
Code: [Select]
(if (vlax-property-available-p OBJ 'Path)
  (progn
    (vla-put-path obj (strcase (vla-get-path obj) T))
    (setq blk (vla-item
(vla-get-blocks
  (vla-get-activedocument
    (vlax-get-acad-object)
    )
  )
(vla-get-name obj)))
    (vla-put-name blk (strcase (vla-get-name obj) T))
  )
)

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Lower case XREF name
« Reply #2 on: January 12, 2006, 12:01:37 PM »
Thanks Jeff :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC