Jump to content
mdwebneck

can the default for deleting a layer after laymrg has been used, be set to YES?

Recommended Posts

mdwebneck

I have a bunch of drawings from our client that were created for construction purposes and were originally made in a Microstation 3D parametric environment so is full of blocks with embedded layers.

Some layers are either not necessary for my 2D work or do not comply with our layername standard, so have been merging the unnecessary layers to 0, so I can move the blocks to proper AIA cad layer names.

 

Is there a way to get "inside" the layer merge command and change the default delete prompt from No to Yes, so I can use the mouse R-click to accept, rather than having to type in Yes everytime?

Share this post


Link to post
Share on other sites
BlackBox

I have a bunch of drawings from our client that were created for construction purposes and were originally made in a Microstation 3D parametric environment so is full of blocks with embedded layers.

Some layers are either not necessary for my 2D work or do not comply with our layername standard, so have been merging the unnecessary layers to 0, so I can move the blocks to proper AIA cad layer names.

 

Not sure what version you're using, but you may also want to obtain the necessary service pack, etc. to utilize DGNPURGE functionality as well, which is built into 2015.

 

 

 

Is there a way to get "inside" the layer merge command and change the default delete prompt from No to Yes, so I can use the mouse R-click to accept, rather than having to type in Yes everytime?

 

Not that I know of, but it is simple to code a small LISP routine that will accomplish same:

 

(defun c:FOO (/ ss)
 (prompt "\nSelect layers to merge with layer \"0\": ")
 (if (setq ss (ssget "_:L"))
   (command "._-laymrg" ss "" "_n" "0" "_y")
 )
 (princ)
)

 

 

 

Cheers

Edited by BlackBox
Word selection. Grr

Share this post


Link to post
Share on other sites
mdwebneck

OK APParently I am lisp challenged ... no real surprise since i've never been involved in creating them

i pasted the code you have above into a text file, saved it as a .lsp

loaded it from the lisp app in autocad which acknowledged it was loaded

but

no change in the laymrg function

 

BTW I'm using v2011 MEP (acad classic enabled)

and

thanks for your help thus for

Share this post


Link to post
Share on other sites
BlackBox
OK APParently I am lisp challenged ... no real surprise since i've never been involved in creating them

i pasted the code you have above into a text file, saved it as a .lsp

loaded it from the lisp app in autocad which acknowledged it was loaded

but

no change in the laymrg function

 

BTW I'm using v2011 MEP (acad classic enabled)

and

thanks for your help thus for

 

No worries; we all start somewhere. :)

 

To reiterate, one cannot modify the default settings, AFAIK (perhaps via Registry?)... However you can use LISP to call the -LAYMRG Command and supply the desired parameters, which is technically more efficient than even what you originally requested.

 

The code I posted implements a custom 'command' named "FOO"... To invoke, simply load the LISP routine (I'd suggest an AUTOLOAD statement in your AcadDoc.lsp file), and then type "FOO" at the Command Line, and hit enter, or right click. Lemon squeezy.

 

Cheers

Share this post


Link to post
Share on other sites
RobDraw
(I'd suggest an AUTOLOAD statement in your AcadDoc.lsp file)

 

... or put it in the "Start up suite" in the appload dialog box.

Share this post


Link to post
Share on other sites
mdwebneck
...

 

The code I posted implements a custom 'command' named "FOO"... To invoke, simply load the LISP routine (I'd suggest an AUTOLOAD statement in your AcadDoc.lsp file), and then type "FOO" at the Command Line, and hit enter, or right click. Lemon squeezy.

 

Cheers

Thanks, I didn't know about FOO :oops:

now as

mr T would say, "I pity the FOO " wink ;)

Share this post


Link to post
Share on other sites
BlackBox
... or put it in the "Start up suite" in the appload dialog box.

 

I respectfully disagree.

 

Startup Suite is less efficient, and less flexible than AcadDoc.lsp which is built-into the Startup Sequence, and generally a very short-sighted approach to customization in a real-world production environment for any user with more than a few custom routines.

 

 

 

Thanks, I didn't know about FOO :oops:

now as

mr T would say, "I pity the FOO " wink ;)

 

No worries; you can change the 'FOO' to anything you want, as it is just a common sample name, like 'TEST', etc. :thumbsup:

 

... Mad points for the Mr. T reference, BTW, sucka. ;)

 

Cheers

Share this post


Link to post
Share on other sites
RobDraw
I respectfully disagree.

 

How can you disagree with something that works?

 

You may have a valid point but I use it all the time to add or remove LISP routines and I work in a real world production environment.

Share this post


Link to post
Share on other sites
BlackBox

(I'd suggest an AUTOLOAD statement in your AcadDoc.lsp file)

 

... or put it in the "Start up suite" in the appload dialog box.

 

I respectfully disagree.

 

How can you disagree with something that works?

 

You may have a valid point but I use it all the time to add or remove LISP routines and I work in a real world production environment.

 

Respectfully, and in this instance quite directly, based on personal experience maintaining multiple versions in both large, and now small production environments.

 

Note that I didn't argue that Startup Suite doesn't work... I did however very clearly identify why it's less efficient, so others don't unknowingly go down a path with such limitations.

 

Cheers

Share this post


Link to post
Share on other sites
RobDraw

Okay, whatever, I was only offering another safer option in case the OP was not familiar with editing that file.

Share this post


Link to post
Share on other sites
BlackBox
Okay, whatever, I was only offering another safer option in case the OP was not familiar with editing that file.

 

Thanks, RobDraw; I think it's a good thing to identify alternatives, as each inherently have their own trade-offs.

 

Please explain how using Startup Suite is safer?

 

Cheers

Share this post


Link to post
Share on other sites
RobDraw

I think you know as well as I do that, if a user that is not familiar with AcadDoc.lsp, that they may edit the closely related AcadyearDoc.lsp by mistake.

Share this post


Link to post
Share on other sites
BlackBox
I think you know as well as I do that, if a user that is not familiar with AcadDoc.lsp, that they may edit the closely related AcadyearDoc.lsp by mistake.

 

What I think you're attempting to point our is that any user code that is added to the AutoCAD-owned Acad20##Doc.lsp file can be overwritten with any application update, and user might lose their custom code without any warning... Technically, there are some that do this too, despite being advised against it because it 'works', which is in line with your criteria.

 

If I go along with you, you've established that Startup Suite may be safer than using Acad20##Doc.lsp, but how is it safer than using AcadDoc.lsp, which was the context of your original statement?

 

Cheers

Share this post


Link to post
Share on other sites
RobDraw

Look, I don't know why you are making such a big deal about this. I did not say that there was anything wrong with your method.

 

Again, I was merely offering a different way of doing it as the OP did not recognize how to start the command and may not be familiar with the document that you suggested. In fact, it might not have even existed on the OPs computer.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...