Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a mleader from a lisp

20 REPLIES 20
SOLVED
Reply
Message 1 of 21
borderliner
2605 Views, 20 Replies

Creating a mleader from a lisp

Hi, all I want to do is create an icon, in a new ribbon tab, that sets the layer to text, and launches the mleader command - so the user can create their mleader on the correct layer. I already have this functionality using the tool palette, but wanted to add it to the ribbon as well.

 

So I figured the easiest way to do it would be write a little lisp routine that makes the layer, then launches the mleader command. I could then call the routine from my icon on the ribbon.

 

It was all going well until the mleader command ran, and I couldn't add the text on-screen, like I normally would - it switched to the command line, and everytime I press space it finishes the command - no good.

 

My attempt:

 

(defun c:ml01(/ ml01)
  (command "cmdecho" "0")
(command "-layer" "m" "text" "c" "4" "" "" )
(command "cmleaderstyle" "text")
  (command "cmdecho" "1")
(command ".mleader"  pause)
(princ)
)

 

Any ideas?

 

Thanks.

 

20 REPLIES 20
Message 21 of 21
hmsilva
in reply to: borderliner


@borderliner wrote:

Holy cow, that was like pulling teeth - I've had more fun at the dentist. 


Smiley Very Happy

 


@borderliner wrote:

 

But I've got it now, using phanaem's code to convert the numbers (thanks phanaem).

 


Glad you've got it!

 

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost