martymcgee Posted January 18, 2007 Share Posted January 18, 2007 I often receive plots that have gone through several people working in VectorWorks and AutoCad. By the time I get them they may have as many as 150 layers. Is there any way to select several layers and merge them into one? Thanks Quote Link to comment
Guest Posted January 18, 2007 Share Posted January 18, 2007 Unfortunately, Mapping Classes and Layers is only available in Architect and Landmark. Do you have Designer? Quote Link to comment
Petri Posted January 18, 2007 Share Posted January 18, 2007 Simple. Layer options to modify others, select all, group. Quote Link to comment
Petri Posted January 18, 2007 Share Posted January 18, 2007 On second thought: as this certainly is a problem for many who do not have Architect or Landmark, here are two scripts that enable more intelligent layer remapping. PROCEDURE LayerMappingData; { ? Petri Sakkinen 1998 - 2007 } VAR layerCount, counter, rowNo : INTEGER; layerName : STRING; theLayer, theWorksheet : HANDLE; BEGIN layerCount := NUMLAYERS + 1; theLayer := FLAYER; theWorksheet := GETOBJECT('Layer mapping'); DELOBJECT(theWorksheet); theWorksheet := CREATEWS('Layer mapping',layerCount, 2 ); SELECTSS(theWorksheet); LOADCELL(1, 1, 'Layer name'); LOADCELL(1, 2, 'Mapped to'); FOR rowNo := 2 TO layerCount DO BEGIN layerName := GETLNAME(theLayer); LOADCELL(rowNo, 1, layerName); theLayer := NEXTLAYER(theLayer); END; END; RUN(LayerMappingData); PROCEDURE RemapLayers; { ? Petri Sakkinen 1999 - 2007 } VAR n, i, rowCount, colCount : INTEGER; oldLayer, newLayer : STRING; theWorksheet, theLayer : HANDLE; ok : BOOLEAN; PROCEDURE RemapLayer (h : HANDLE); BEGIN ok := SETPARENT(h, theLayer); END; BEGIN theWorksheet := GETOBJECT('Layer mapping'); SPRDSIZE(theWorksheet, rowCount, colCount); SELECTSS(theWorksheet); FOR n := 2 TO rowCount DO BEGIN oldLayer := GETCELLSTR(theWorksheet, n, 1); newLayer := GETCELLSTR(theWorksheet, n, 2); IF NOT(newLayer='') THEN BEGIN theLayer := GETLAYERBYNAME(newLayer); FOREACHOBJECT(RemapLayer, L = oldLayer); END; END; END; RUN(RemapLayers); So, first you run LayerMappingData, which creates a worksheet with all layer names. Then for those layers you want to merge with another layer, type (or paste) the name of the new layer into column B of the worksheet. Finally you run RemapLayers. If you get data with the same setup frequently, import the worksheet into the new file and just run RemapLayers. And what the heck, I'm in a generous mood. One more - this groups everything on each layer. It may be a wise thing to do before merging because you can (with some effort) get the contents of one layer extracted. PROCEDURE Layers2groups; { ? Petri Sakkinen 1995 - 2007 } VAR theLayer : HANDLE; layerName : STRING; ok : BOOLEAN; BEGIN theLayer := FLAYER; ok := YNDIALOG('This macro sets your layer options to active only'); IF ok THEN BEGIN DOMENUTEXTBYNAME('Layer options', 1); WHILE NOT(theLayer = NIL) DO BEGIN; LayerName:=GETLNAME(theLayer); LAYER(LayerName); SELECTALL; GROUP; theLayer := NEXTLAYER(theLayer); END; END; END; RUN(Layers2groups); Quote Link to comment
martymcgee Posted January 28, 2007 Author Share Posted January 28, 2007 Thanks so much. I made it through this plot but as soon as this job is finished I'm going to work with these scripts. Quote Link to comment
Recommended Posts
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.