Results 1 to 9 of 9

Thread: LISP for setting Mleaderstyle then creating Mleader not working

  1. #1
    Member
    Join Date
    2016-12
    Posts
    10
    Login to Give a bone
    0

    Default LISP for setting Mleaderstyle then creating Mleader not working

    Hello all,

    I have searched all over and cannot find an answer as to why this is not working. I want to create a LISP that will change the Mleaderstyle to an existing style and then start a Multileader on the correct layer.

    I created a custom command from the CUI called 'Proposed Multileader'. In the 'Tool Properties' box I have this set to the 'P-Anno' layer and I have it set to use the 'Proposed' text style.

    I have a Multileader Style setup as 'Proposed' with all the correct variables.

    This is the code I have in the Command String section of the 'Tool Properties': (setvar "cmleaderstyle" "Proposed") ^C^C_mleader

    It starts the multileader command, but does not change the mleaderstyle to 'Proposed'.

    Any help is appreciated.

    Thanks

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Hi,

    You need to leave the command name as a string reserved for the command name that you would like to call to use what has written in the macro section, so just add the following into the macro section:

    Code:
    ^C^C(setvar "cmleaderstyle" "Proposed") _mleader
    Note:
    1- You need to be sure is that the Mleader style name is available into your current drawing otherwise an error would occur.
    2-Note that there is a space before the Mleader command.

    The name of the command and as shown in the attached image is: Test and you can rename as per your needs.

    cui.PNG

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    That works fine here.

    Are you sure that the mleaderstyle "proposed" exists? It can't switch to it, if it doesn't exist.
    R.K. McSwain | CAD Panacea |

  4. #4
    Member
    Join Date
    2016-12
    Posts
    10
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Thank you Tharwat. It all had to do with where I had the ^C^C in the code.


    I did have the proposed mleaderstyle in the drawing, but I did check again when you mentioned it just to be sure.

    Quote Originally Posted by Tharwat View Post
    Hi,

    You need to leave the command name as a string reserved for the command name that you would like to call to use what has written in the macro section, so just add the following into the macro section:

    Code:
    ^C^C(setvar "cmleaderstyle" "Proposed") _mleader
    Note:
    1- You need to be sure is that the Mleader style name is available into your current drawing otherwise an error would occur.
    2-Note that there is a space before the Mleader command.

    The name of the command and as shown in the attached image is: Test and you can rename as per your needs.

    cui.PNG

  5. #5
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Quote Originally Posted by Hollyfeld View Post
    Thank you Tharwat. It all had to do with where I had the ^C^C in the code.

    I did have the proposed mleaderstyle in the drawing, but I did check again when you mentioned it just to be sure.
    That sounds you got it working now. Right?

  6. #6
    Member
    Join Date
    2016-12
    Posts
    10
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Quote Originally Posted by Tharwat View Post
    That sounds you got it working now. Right?
    Oops, I should have clarified that I got it working.

  7. #7
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Quote Originally Posted by Hollyfeld View Post
    Oops, I should have clarified that I got it working.
    Great to hear that.

  8. #8
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Quote Originally Posted by Hollyfeld View Post
    Thank you Tharwat. It all had to do with where I had the ^C^C in the code.

    Not here it didn't.
    I would not have put a ^c^c where you did, but I did test it that way, and it works just fine.
    R.K. McSwain | CAD Panacea |

  9. #9
    Member
    Join Date
    2016-12
    Posts
    10
    Login to Give a bone
    0

    Default Re: LISP for setting Mleaderstyle then creating Mleader not working

    Quote Originally Posted by rkmcswain View Post
    Not here it didn't.
    I would not have put a ^c^c where you did, but I did test it that way, and it works just fine.
    I thought it made sense to have the ^C^C where I had it originally, but for some reason it didn't work.

Similar Threads

  1. MLeader Lisp Trouble
    By billy342601 in forum AutoLISP
    Replies: 31
    Last Post: 2022-12-08, 04:25 PM
  2. Mleader Scale using Lisp
    By CadDog in forum AutoLISP
    Replies: 7
    Last Post: 2012-10-29, 10:29 PM
  3. LISP, Mleader and text editor
    By jsoto1685 in forum AutoLISP
    Replies: 3
    Last Post: 2011-07-28, 03:45 PM
  4. Mleader with Text Lisp Routine
    By EPN in forum AutoLISP
    Replies: 3
    Last Post: 2010-10-12, 08:50 PM
  5. Mleader Lisp File
    By g_wong in forum AutoLISP
    Replies: 1
    Last Post: 2008-08-04, 08:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •