How this lisp picks where leader points to

How this lisp picks where leader points to

gotphish001
Advisor Advisor
1,456 Views
5 Replies
Message 1 of 6

How this lisp picks where leader points to

gotphish001
Advisor
Advisor

Cleaning up some old details and grabbed this lisp to speed it up. Not so much a problem, but I can't figure out how this lisp picks where the leader points too. Running the lisp. Sometimes when you pick the leader and then the text, the new Mleader keeps the position of the arrow. Other times it moves it. First I thought it had to do with how the Mtext was justified. Nope. Then I thought it was that some of the Mtext editing windows where extra long. Fixed those, but it didn't change it. Every time I found some difference between a leader that kept its arrow location and one that didn't, I thought I figured it out. None of that seems to matter though. 

 

It's not really an issue moving the arrow to where it's supposed to be once it is combined into a Mleader as the lisp speeds it up so much anyway. Just sometimes it works as I would want it to, so it's bothering me when it doesn't. haha  This is what happens on days I'm finding things to do. 

 

 

In the attached is a part of a detail I'm cleaning up. First 2 leaders move the dot. Second 2 leaders keep dots locations.



Nick DiPietro
Cad Manager/Monkey

0 Likes
Accepted solutions (1)
1,457 Views
5 Replies
Replies (5)
Message 2 of 6

ВeekeeCZ
Consultant
Consultant
Accepted solution

The first - your "sometimes" is effected by running osnaps. Turn them off.

 

Then edit your lisp to put semicolons in front of the ERASE commands:

 

; (COMMAND "_ERASE" mtext "") ; erase text picked
; (command "_erase" leader "") ; erase leader picked

 

Set the current color to be different than yellow, perform your L2ML command and you'll see.

0 Likes
Message 3 of 6

gotphish001
Advisor
Advisor

Great! I never would have thought of that as it doesn't give you the icons. Just because I had time I did some further testing just to prove what you said. I added text to the mtext so it was much longer. That way I could select the text far away from anything else and it worked even with snaps on. 

 

Thanks again. If I can figure it out I'll try and add it so it turns the snaps off and then back on. 



Nick DiPietro
Cad Manager/Monkey

0 Likes
Message 4 of 6

ВeekeeCZ
Consultant
Consultant
Or just put "none" before each pt within the (command)
0 Likes
Message 5 of 6

gotphish001
Advisor
Advisor

I'm missing something. I tried to get it to use the none snap but it isn't working. I tried just turning snaps off and then back on which works but if I esc out of the command they are still off. That and if they are off when I run the lisp it turns them back on. I know you can put checks in but I'm not that far into learning what the hell I'm doing with lisp yet.  I have some java, c+ experience from a long time ago which is mostly forgotten but I just started playing with lisps. I thought it would help if I started by slightly changing a lisp that was made by someone else like this one, but maybe I need to start at the beginning for a refresher. 



Nick DiPietro
Cad Manager/Monkey

0 Likes
Message 6 of 6

ВeekeeCZ
Consultant
Consultant

@gotphish001 wrote:

 

I'm missing something. I tried to get it to use the none snap but it isn't working.

 

// Must have done something wrong, see the M2ML1 version.

 

 

I tried just turning snaps off and then back on which works but if I esc out of the command they are still off.

 

// Right. You need to add the *error* function. See the MLML2 version.

 

 

That and if they are off when I run the lisp it turns them back on. I know you can put checks in but I'm not that far into learning what the hell I'm doing with lisp yet.  I have some java, c+ experience from a long time ago which is mostly forgotten but I just started playing with lisps. I thought it would help if I started by slightly changing a lisp that was made by someone else like this one, but maybe I need to start at the beginning for a refresher. 

 

// Good idea. See the M2ML1 version how would I make it. (it takes different second point than the previous versions)


 

0 Likes