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

Convert All Multileaders into "Old" Leaders

11 REPLIES 11
Reply
Message 1 of 12
bbarkman
6775 Views, 11 Replies

Convert All Multileaders into "Old" Leaders

Hello Gurus,

 

Attached is a Lisp that will select a multilieader and replaced it with a regular leader.  All properties are preserved.  What this command needs is the ability to scan an entire drawing and replace all multileaders with regular leaders, and ultimately select multiple files and do the same thing.

 

I have been unsuccessful in processing all multileaders without having to select each one individually (I'm a bit rusty).  I know that I need to build a selection set and then make a list of all the multileaders in the selection set, then do something like a "foreach" or "repeat" etc.

 

Feel free to take this Lisp and use it for your needs but I hope that I can get some help making this work on all multileaders.

 

Thanks in advance for your help.

 

Brett Barkman

Jedson Engineering Inc.

11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: bbarkman

I crudely put this together, see if it works.  You may need to re-enter your global variables cause I took them off to check the results on screen.  Adjust spacing to your preference.  HTH.

Message 3 of 12
bbarkman
in reply to: Anonymous

It's closer.  I selected each multileader.  The were converted to leaders, but the associated text was deleted.  Also, the goal is to not have to select the multileaders.  I'd like to be able to just run the command and have it process them automatically.  If we could replace "Select Mleaders Objects" with something that just goes after mleaders I think it will run quicker.

 

Also, I tried typing "all" instead of picking and all other entities in the drawing were erased except for the multileaders, which were still converted.

 

Still getting warmer I think.  Any other thoughts?

Message 4 of 12
Anonymous
in reply to: bbarkman

Sorry, Now I know why you exploed the mleaders and not do what I did.  I didn't look at the whole picture.  If you replace what I put in to your version it should be okay.  You would have to do a tblsearch to get it to do what you want. 

 

Take that back (setq Q (tblsearch "MULTILEADER" "STANDARD")) doesn't work.  I get an invalid table function argument.

Message 5 of 12
Anonymous
in reply to: bbarkman

Try this for your selection set:  Then you could use your all command.

 

(setq jnk (ssget '((0 . "MULTILEADER"))))

Message 6 of 12
bbarkman
in reply to: Anonymous

I have that already.  Check out this version.  I managed to build a list of entity names but when it runs this error occurs:

 

error: bad argument type: consp <Entity name: 7ffffb09230>

 

I think it has something to do with the list created in the "repeat" section.

Message 7 of 12
Anonymous
in reply to: bbarkman

Here you go!!!!

Message 8 of 12
bbarkman
in reply to: Anonymous

Nice!!!

I think I will try to take "all" out of the equation.  If all we're after are the mleaders, it will be nice to just type in the command (or click button, whatever, I'll do that later) and have run.

 

Anyway, I appreciate your help.  Hopefully you will be able to utilize this as well.

 

Regards.

Message 9 of 12
Anonymous
in reply to: bbarkman

Naw, I'm a little to old school for all these newances, like Multileaders, Annotative Text and Dynamic Blocks.  I have read so many posts of problems they cause in exchanging information down to lower versions.  I know it's not my problem if they don't upgrade but when I am the one having to deal with it.  It makes my life easier to transfer data.  I have had spineless supervisors that don't tell them it's your problem and not ours because we tell them up front what version we use.  I know they have their use but some people don't know how to use them properly in my opinion and then they are posting why they are having problems.

 

My pleasure in helping you on this.  If you want it to "autorun" upon loading type (C:MLDR2LDR) as your last line of lsp.

Message 10 of 12
bbarkman
in reply to: Anonymous

That's what this will be for; a client that uses an older release.  I wish they would get up to date but you can't force them.  We don't mind doing it because they are paying us for this kind of service.  If they weren't, I would probably tell them to update since technically old releases aren't supported (if they're old enough).

 

Anyway, I want to clarify "autorun."  What I want this to do is operate on the multileaders without prompting the user.

 

I tweaked the line containing SSGET so that it just goes after the mleaders (no user input).  It worked.  But, the resulting leaders now have a crooked landing line (see attach image and updated lisp).  There must be something wrong with the points used to draw the new leaders.

 

How are you with acquiring points?

 

We're almost there!

Message 11 of 12
Anonymous
in reply to: bbarkman

What I meant about autorun, is that you wouldn't have to type the command name at the command prompt.  It would start running as soon as it is loaded and no typing of MLDR2LDR.

 

For your crooked leaders, what do you have your object snaps set to?  Sometimes when you run a iisp program and you have a running osnap, it will snap to the object and not take the actual coordinates.  If this is the problem place a (setvar "OSMODE" 0) after you extract the current layer name and then reset it when you exit if you want.

 

For the points I used your function so you probably are as good as I am on acquiring points.  But if you are still having issues, repost and I'll see if I can help.

Message 12 of 12
bbarkman
in reply to: Anonymous

That did the trick.  I forgot about OSMODE.  I'll probably won't autorun it because this is for a specific client.  It could be counterproductive to automatically nuke mleaders upon opening any drawing (we use them a lot).  Next I'm going to attempt to adapt the code so that you can select multiple drawings and do the same thing.  I think that will require DOSLIB which I am not too familiar with.  This will work just fine in the meantime.

 

Thanks again for your help!

 

BTW...here is the updated lisp.

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

Post to forums  

Autodesk Design & Make Report

”Boost