Author Topic: Modify existing multileader style  (Read 3534 times)

0 Members and 1 Guest are viewing this topic.

Chris

  • Swamp Rat
  • Posts: 548
Modify existing multileader style
« on: September 20, 2011, 04:07:24 PM »
I havent had much luck googling this topic.  I'm trying to figure out how to modify an existing mulitleader style using VL.
I know how to put property and such, my problem is I dont know how to set the multileader style as a vl object.  I can search the multileader dictionary for all the styles, I just dont know how to pick one.  I'm sure I have done it in the past, my brain just isnt working today.

Thanks,
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Modify existing multileader style
« Reply #1 on: September 20, 2011, 04:16:30 PM »
This might help you out:

Code: [Select]
  (setq dict (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object))))
  (setq mldict (vl-catch-all-apply 'vla-item (list dict "ACAD_MLEADERSTYLE")))
  (vla-item mldict 0)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Chris

  • Swamp Rat
  • Posts: 548
Re: Modify existing multileader style
« Reply #2 on: September 20, 2011, 04:29:18 PM »
Thanks but,
the variant I have is:
Code: [Select]
(setq mlddict (vla-item (vla-get-dictionaries acadDocument) "ACAD_MLEADERSTYLE"))
it returns the same thing.  How do I actually select a style to modify it?
I'd like to use:
Code: [Select]
(vlax-put-property mldstyle 'ArrowSize 0.125)
where mldstyle is the multileader style I want to modify.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Modify existing multileader style
« Reply #3 on: September 20, 2011, 04:47:54 PM »
Use vla-item and the name of the mleaderstyle to get the object.

Like so: (vla-item mldict "standard")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Chris

  • Swamp Rat
  • Posts: 548
Re: Modify existing multileader style
« Reply #4 on: September 20, 2011, 05:00:42 PM »
Thanks, Ronjon, I understand now:
Code: [Select]
(defun c:mleaderstylecreate (/ dict mldict mldstyle thgt)
      (setq dict   (vla-get-dictionaries acadDocument)
    mldict (vl-catch-all-apply 'vla-item (list dict "ACAD_MLEADERSTYLE"))
      ) ;_ end of setq
      (if (setq ss (sstdblk "TBLK 8x11"))
(setq thgt 0.06)
(setq thgt 0.09))
      (if (setq mldstyle (vla-item mldict "Engineering"))
(progn
  (vlax-put-property mldstyle 'ArrowSize 0.125)
  (vlax-put-property mldstyle 'LandingGap (/ thgt 2))
  (vlax-put-property mldstyle 'TextHeight thgt)
) ;_ end of progn
      ) ;_ end of if
    ) ;_ end of defun
it may or may not be of use to anyone else, but it will come in handy here until we are done switching over to our new standards.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Modify existing multileader style
« Reply #5 on: September 22, 2011, 12:27:06 PM »
Thanks, Ronjon, I understand now:
Code: [Select]
(defun c:mleaderstylecreate (/ dict mldict mldstyle thgt)
      (setq dict   (vla-get-dictionaries acadDocument)
    mldict (vl-catch-all-apply 'vla-item (list dict "ACAD_MLEADERSTYLE"))
      ) ;_ end of setq
      (if (setq ss (sstdblk "TBLK 8x11"))
(setq thgt 0.06)
(setq thgt 0.09))
      (if (setq mldstyle (vla-item mldict "Engineering"))
(progn
  (vlax-put-property mldstyle 'ArrowSize 0.125)
  (vlax-put-property mldstyle 'LandingGap (/ thgt 2))
  (vlax-put-property mldstyle 'TextHeight thgt)
) ;_ end of progn
      ) ;_ end of if
    ) ;_ end of defun
it may or may not be of use to anyone else, but it will come in handy here until we are done switching over to our new standards.
I took the sidestep around this issue, I created a drawing with all of our standard mleader styles and use the following line:

(vl-cmdf "._-insert" "Uleader.dwg")(command)

It avoided me having to figure out all of the above. We having been using mLeaders since they came out, so we have quite a few routines written around them, so if you need help getting your routines working with mLeaders, please ask.

Chris

  • Swamp Rat
  • Posts: 548
Re: Modify existing multileader style
« Reply #6 on: September 22, 2011, 12:29:23 PM »
yes, but if the style already exists within a drawing, does it update it?  that's the main reason for my question, we changed our standard arrow size recently, and we are updating existing projects.  That, and I also wrote a routine that would change the standard text height depending on if we were using full size plans, or 8x11.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Modify existing multileader style
« Reply #7 on: September 23, 2011, 12:21:38 PM »
yes, but if the style already exists within a drawing, does it update it?  that's the main reason for my question, we changed our standard arrow size recently, and we are updating existing projects.  That, and I also wrote a routine that would change the standard text height depending on if we were using full size plans, or 8x11.
Ah, I see, not that will not change it, so I guess you are stuck with having to modify it. I am curious how you accomplished the routine with the plotting part though.

Chris

  • Swamp Rat
  • Posts: 548
Re: Modify existing multileader style
« Reply #8 on: September 23, 2011, 12:25:38 PM »
based on the title block that has been inserted in the drawing.  I would guess that I would need to modify the program if we had multiple layouts with multiple sizes, so it only looks at the current one, but as that is not our standard, I left it simply to look in the drawing to see if the particular title blocks exist.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10