Author Topic: MLEADER OPTIONS  (Read 3610 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
MLEADER OPTIONS
« on: April 03, 2018, 01:05:14 PM »
Hi guys,.

is there any way to get the status of these options ?

Command: MLEADER
Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>:



Command: MLEADER
Specify leader landing location or [leader arrowHead first/Content first/Options] <Options>:


the fact is that I can't use (command "_MLEADER"...) and don't have the courage to create prog to prevent this..... :glarestraight:

any help will be appreciated.
Thank you.
Keep smile...

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: MLEADER OPTIONS
« Reply #1 on: April 03, 2018, 01:25:56 PM »
IF the DXF codes for the objects will help they are listed in documentation.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Dlanor

  • Bull Frog
  • Posts: 263
Re: MLEADER OPTIONS
« Reply #2 on: April 03, 2018, 01:39:43 PM »
MLeader Style has the DrawMLeaderOrderType property which can have two possible values

acDrawLeaderHeadFirst : draws line starting at arrowhead (default)

acDrawLeaderTailFirst : Starts with text entry prompt then starts line at the landing/vertex junction

Andrea

  • Water Moccasin
  • Posts: 2372
Re: MLEADER OPTIONS
« Reply #3 on: April 03, 2018, 01:44:58 PM »
Thank you guys...very appreciated.. :)
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: MLEADER OPTIONS
« Reply #4 on: April 03, 2018, 01:51:43 PM »
well,..after making tests...

the value seem to still same...
so I still stuck with this..
Keep smile...

Crank

  • Water Moccasin
  • Posts: 1503
Re: MLEADER OPTIONS
« Reply #5 on: April 03, 2018, 03:10:42 PM »
I think it's some kind of registry setting. You can download Process Monitor to monitor registry changes. It works in real time and shows all system files, registry changes and processes/threads of your system  (many similar tools from other sources also exist).

If you don’t like using third-party software for performing system tasks, or any other tasks in Windows. Reg (or RegEdit) and FC are Windows’ built-in commands, which allow you to monitor and compare states of your registry.


Vault Professional 2023     +     AEC Collection

Andrea

  • Water Moccasin
  • Posts: 2372
Re: MLEADER OPTIONS
« Reply #6 on: April 03, 2018, 04:22:22 PM »
I think it's some kind of registry setting. You can download Process Monitor to monitor registry changes. It works in real time and shows all system files, registry changes and processes/threads of your system  (many similar tools from other sources also exist).

If you don’t like using third-party software for performing system tasks, or any other tasks in Windows. Reg (or RegEdit) and FC are Windows’ built-in commands, which allow you to monitor and compare states of your registry.

Thank you,...
I've allready done that but no variable or reg key seem to be added or changed..
I tooked a look into xdata and sysvdlg..but no modification..  :|
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: MLEADER OPTIONS
« Reply #7 on: April 03, 2018, 06:46:10 PM »
As far as I'm aware, the state of the MLeader options is not accessible through system variables or registry values (that are updated in real-time at least), nor is this information exposed to the LISP API.

However, one workaround to 'force' the MLeader command into a known state (e.g. Arrowhead First) is to issue the following prior to invoking the command:

Code - Auto/Visual Lisp: [Select]
  1. (defun NormaliseMLeader ( / cmd ent tmp )
  2.     (setq cmd (getvar 'cmdecho)
  3.           ent (entlast)
  4.     )
  5.     (while (setq tmp (entnext ent)) (setq ent tmp))
  6.     (setvar 'cmdecho 0)
  7.     (vl-cmdf "_.mleader" "_h") ;; Force arrowhead first
  8.     (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "0,0"))
  9.     (if (not (eq ent (setq ent (entlast)))) (entdel ent))
  10.     (setvar 'cmdecho cmd)
  11.     t
  12. )

However this isn't the cleanest solution, yielding an unavoidable "Invalid Input" should the 'Arrowhead First' option already be enabled.

I believe this solution was first suggested by Stefan at some point - so all credit to him.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: MLEADER OPTIONS
« Reply #8 on: April 03, 2018, 07:21:17 PM »
There are still some minor bugs that some people run up against with my code, but you could take a look at my ULEADER command for some inspiration. The code is massive and is definitely geared toward our company standards, but I think a lot could be learned there. Pay special attention to all of the sections that Lee Mac and several others from The Swamp have contributed.

NOTE: Be sure to put the uleader.dwg file in a path that AutoCAD will search in.

As you can see, programming ULeaders is definitely not for the faint of heart and honestly I am sure that someone like Lee Mac could go through my code, add better error handling and probably cut the number of lines of code in half.

But using these methods would eliminate the issues you are having because it would eliminate the use of (command "._uleader").

ribarm

  • Gator
  • Posts: 3282
  • Marko Ribar, architect
Re: MLEADER OPTIONS
« Reply #9 on: April 04, 2018, 04:26:35 AM »
As far as I can recall, version 3.0k that was posted here was last one... Your attachment is little bigger - you changed something, right?

https://www.theswamp.org/index.php?topic=46576.msg539760#msg539760
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: MLEADER OPTIONS
« Reply #10 on: April 04, 2018, 02:24:55 PM »
FYI:
With BricsCAD this setting is available is the registry, and, contrary to many other settings, is updated in real-time.
Code: [Select]
(defun Mleader_ArrowHeadFirst_P ()
  (/=
    0
    (vl-registry-read
      (strcat
        "HKEY_CURRENT_USER\\"
        (vlax-product-key) "\\"
        "Profiles\\"
        (getvar 'cprofile) "\\"
        "MLeader\\"
      )
      "Mode"
    )
  )
)

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: MLEADER OPTIONS
« Reply #11 on: April 04, 2018, 02:48:38 PM »
With BricsCAD this setting is available is the registry, and, contrary to many other settings, is updated in real-time.
Code: [Select]
(defun Mleader_ArrowHeadFirst_P ()
  (/=
    0
    (vl-registry-read
      (strcat
        "HKEY_CURRENT_USER\\"
        (vlax-product-key) "\\"
        "Profiles\\"
        (getvar 'cprofile) "\\"
        "MLeader\\"
      )
      "Mode"
    )
  )
)

An equivalent key exists in AutoCAD (though named 'CreatedMode' in lieu of 'Mode'), however such key is not updated in real-time but only when AutoCAD is closed, rendering it useless for this task  :|

BricsCAD wins again.  :lol:

Andrea

  • Water Moccasin
  • Posts: 2372
Re: MLEADER OPTIONS
« Reply #12 on: April 04, 2018, 03:48:03 PM »
Thank you guys,...

the problem comes when using MLEADER without LEADER !
so the selection ask only to enter 1 coordinate point instead of leader arrow point and text location..
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: MLEADER OPTIONS
« Reply #13 on: April 04, 2018, 05:22:43 PM »
Thank you guys,...

the problem comes when using MLEADER without LEADER !
so the selection ask only to enter 1 coordinate point instead of leader arrow point and text location..

You can account for this by checking the MLeader Style properties.

Dlanor

  • Bull Frog
  • Posts: 263
Re: MLEADER OPTIONS
« Reply #14 on: April 04, 2018, 07:09:50 PM »
If you want to create a leader tail first, create a new temp style with the DrawMLeaderOrderType property set to acDrawLeaderTailFirst. Mleaders created with this style using command  _mleader will default to startiing at the tail. I don't think this applies to creating the object via AddMLeader though, unless you reverse the point order in the safe array (not tested). Once the leader is formed you can change it's style and it will take on the properties of the new style i.e. leader will disappear if leader type in new style is none.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: MLEADER OPTIONS
« Reply #15 on: April 05, 2018, 10:09:48 AM »
Thank you guys,..

I finally solve this issue by putting this code before creating Mleader.:

Code: [Select]
(command "_.mleader" "_H")(command)
 :knuppel2:
Keep smile...

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: MLEADER OPTIONS
« Reply #16 on: April 05, 2018, 02:27:07 PM »
As far as I can recall, version 3.0k that was posted here was last one... Your attachment is little bigger - you changed something, right?

https://www.theswamp.org/index.php?topic=46576.msg539760#msg539760
I believe that version has some of our company specific stuff removed, which would explain why this file is larger, but I don't think anything else changed, but I could be wrong.