Author Topic: TblSearch for mleaderstyles??  (Read 1657 times)

0 Members and 1 Guest are viewing this topic.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
TblSearch for mleaderstyles??
« on: August 28, 2017, 01:43:34 PM »
Is there not a table for mleaderstyles? I'm trying to determine if a style exists in a drawing.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

ronjonp

  • Needs a day job
  • Posts: 7529
Re: TblSearch for mleaderstyles??
« Reply #1 on: August 28, 2017, 01:46:19 PM »
This works for me:

Code - Auto/Visual Lisp: [Select]
  1. (and (setq d (dictsearch (namedobjdict) "acad_mleaderstyle"))
  2.      (setq ed (cdr (assoc -1 d)))
  3.      (dictsearch ed mlstylename)
  4. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: TblSearch for mleaderstyles??
« Reply #2 on: August 28, 2017, 02:03:33 PM »

Another variation with activex:

Code - Auto/Visual Lisp: [Select]
  1. (defun MleaderStylep ( nm )
  2.   (cond
  3.     (
  4.         (setq nm
  5.           (vl-catch-all-apply 'vla-item
  6.             (list (vla-item (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE") nm)
  7.           )
  8.         )
  9.       )
  10.       (prompt (strcat "\nError: " (vl-catch-all-error-message nm)))
  11.     )
  12.     ( nm )
  13.   )
  14. ); defun MleaderStylep
  15.  
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: TblSearch for mleaderstyles??
« Reply #3 on: August 28, 2017, 02:18:49 PM »
Thanks, Ron. Shortly after posting I came across basically the same thing you posted (that's usually how it works, right?).

And thanks Grrr1337 for your input.  :)
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

ronjonp

  • Needs a day job
  • Posts: 7529
Re: TblSearch for mleaderstyles??
« Reply #4 on: August 28, 2017, 03:12:22 PM »
Thanks, Ron. Shortly after posting I came across basically the same thing you posted (that's usually how it works, right?).

And thanks Grrr1337 for your input.  :)
Glad to help :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC