Author Topic: Special Layer translate LIST requred  (Read 8687 times)

0 Members and 1 Guest are viewing this topic.

sjeveni

  • Guest
Special Layer translate LIST requred
« on: December 30, 2011, 06:44:15 AM »
Hi everybody.
I'm new on this forum and would like to ask you for a favour.
We are facing some problems while dealing with Xref's. Few people select Bind instead of Insert command. This creats mess in our Layer system. I'm  searching a List that could translate these layers back into normal ones.
Some may say, whay don't you use Layer translator? It is not sutable for the amount of layers that we need to correct.
 
So the problem is next:
We need to translate back in normal layers (let's cal them A-1, A-2, A-3, A-4,....) from prefix that they got while Binding and looks:
4176-X_TT$0$A-1
4176-X_TT$0$A-2
4176-X_TT$0$A-3
4176-X_TT$0$A-4
4176-X_TT$0$A-5.....
 
4176-X_SS$0$A-1
4176-X_SS$0$A-2
4176-X_SS$0$A-3
4176-X_SS$0$A-4
4176-X_SS$0$A-5...
....
 
I need that all numbers, symblos, letters.... before real Layers name dissaper.
Please note that becouse of few diferent Xref's in my drawing it is also few diferent prefix (4176-X_TT$0$ or 4176-X_SS$0$....), so list should be writen so that we can write different prefix TT or SS.
 
Thank you in advance

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
« Last Edit: December 30, 2011, 09:22:01 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

hmspe

  • Bull Frog
  • Posts: 362
Re: Special Layer translate LIST requred
« Reply #2 on: December 30, 2011, 09:17:03 AM »
Look at this thread:  http://www.theswamp.org/index.php?topic=17496.msg210985#msg210985

As is noted in the thread you need to be aware that not all layers will be automatically renamed with the code in the thread.  In your example if the drawing has a layer named    A-1    then a layer named    4176-x_TT$0$A-1    would not be renamed.  It would not be hard to add code to handle layers that would change to layer names that already exist, but you might get unwanted results unless you are sure that the layer names in both the main drawing and in the xref meet your layering standards.  An example would be a main drawing with a layer named    WALLS    that was new construction and an xref with a layer named    WALLS    that was walls to be removed.  Merging the data to a single layer would probably be undesirable in this case.   
"Science is the belief in the ignorance of experts." - Richard Feynman

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Special Layer translate LIST requred
« Reply #3 on: December 30, 2011, 09:24:39 AM »
I assume what he wanted was this:
Code: [Select]
4176-X_TT$0$A-1         TT_A-1     
4176-X_TT$0$A-2         TT_A-2     
4176-X_TT$0$A-3         TT_A-3     
4176-X_TT$0$A-4         TT_A-4     
4176-X_TT$0$A-5.....    TT_A-5.....
                          _       
4176-X_SS$0$A-1         SS_A-1     
4176-X_SS$0$A-2         SS_A-2     
4176-X_SS$0$A-3         SS_A-3     
4176-X_SS$0$A-4         SS_A-4     
4176-X_SS$0$A-5...      SS_A-5... 
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

hmspe

  • Bull Frog
  • Posts: 362
Re: Special Layer translate LIST requred
« Reply #4 on: December 30, 2011, 12:27:10 PM »
CAB,

Entirely possible that your interpretation is correct.  The top portion of the OP says that the normal layer would be A-1, with all letters, symbols, and text before the normal layer name removed for bound layers.  The last part of the OP says that some parts of the text before the normal layer name might need to be retained.  The two seem to be contradictory. 

Maybe sjeverni can clarify the request. 
"Science is the belief in the ignorance of experts." - Richard Feynman

sjeveni

  • Guest
Re: Special Layer translate LIST requred
« Reply #5 on: December 30, 2011, 01:00:23 PM »
I appologize if I was not clear.
I need layers to be A-1, not SS_A-1.

This is the case.
Let's say that we have project no. 4176. And in the drawing we have xref for every floor (AA, BB, CC.... SS, TT....) and we have common layers A-1, A-2....
So when someone decide to "Bind" these xref instead to use "Insert" we are getting:
4176-X_TT$0$A-1   
4176-X_TT$0$A-2
4176-X_TT$0$A-3 only for one floor, but then is a next floor:
4176-X_UU$0$A-1   
4176-X_UU$0$A-2
4176-X_UU$0$A-3... and depends of how many floors do we have, it will be so many layers that are basicaly of the same charachteristics as the other from different floors.

So I need Lisp that will take all A-1, A-2.....K-20 layers and get ridd of:
4176-X_TT$0$ or 4176-X_UU$0$ so that all different A-1 comes into single A-1 layer.

The project number is allways the same (in this case 4176, we should have possibilities to change that depends of project number) layers are allways standards (I can fill them my self later... some cca. 20 diferent layers).

Please ask questions if you need more info.

Again, thank you very much for the any help that you can provide.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Special Layer translate LIST requred
« Reply #6 on: December 30, 2011, 01:13:31 PM »
So to summarize … strip & merge?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

sjeveni

  • Guest
Re: Special Layer translate LIST requred
« Reply #7 on: December 30, 2011, 01:20:33 PM »
MP,
I'm not sure what does it meens (my english is not so god)  8-)

sjeveni

  • Guest
Re: Special Layer translate LIST requred
« Reply #8 on: December 30, 2011, 01:24:59 PM »
Look at this thread:  http://www.theswamp.org/index.php?topic=17496.msg210985#msg210985

As is noted in the thread you need to be aware that not all layers will be automatically renamed with the code in the thread.  In your example if the drawing has a layer named    A-1    then a layer named    4176-x_TT$0$A-1    would not be renamed.  It would not be hard to add code to handle layers that would change to layer names that already exist, but you might get unwanted results unless you are sure that the layer names in both the main drawing and in the xref meet your layering standards.  An example would be a main drawing with a layer named    WALLS    that was new construction and an xref with a layer named    WALLS    that was walls to be removed.  Merging the data to a single layer would probably be undesirable in this case.

Hi hmspe,
maybe you are on something here.
I just want one (as you proposed) WALLS layer. And, for sure, we will have in the drawing layer called WALLS but all the rest prefixWALLS layers must be transfered into existing WALLS layer.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Special Layer translate LIST requred
« Reply #9 on: December 30, 2011, 01:34:06 PM »
MP,
I'm not sure what does it meens (my english is not so good)  8-)

Strip (remove unwanted prefixes) & Merge (combine identical layer names).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

sjeveni

  • Guest
Re: Special Layer translate LIST requred
« Reply #10 on: December 30, 2011, 02:15:29 PM »
Strip (remove unwanted prefixes) & Merge (combine identical layer names).
[/quote]

Yes, great.... how can we do it :)???

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Special Layer translate LIST requred
« Reply #11 on: December 30, 2011, 03:08:59 PM »
It's been done; many times. Wait 'til some one posts a link or code. I'm too tired to do either at present. Sorry.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Special Layer translate LIST requred
« Reply #12 on: December 30, 2011, 04:28:03 PM »
So what do you get when you run this code?
http://www.theswamp.org/index.php?topic=17496.0
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

sjeveni

  • Guest
Re: Special Layer translate LIST requred
« Reply #13 on: December 31, 2011, 04:56:52 AM »
will need to check that on Monday....
Happy New Year everybody :D

Crank

  • Water Moccasin
  • Posts: 1503
Re: Special Layer translate LIST requred
« Reply #14 on: December 31, 2011, 08:25:18 AM »
@ CAB: That will only rename, but when a layer or linetype already exists it doesn't merge.

@ sjeverni: In my library I found the attached file, but I've to warn you that I've never tried it.
Vault Professional 2023     +     AEC Collection