Gentile Romano Posted September 15, 2014 Share Posted September 15, 2014 Dear all; How to write a Macro for Merge Layers.............. ^C^C_laymrg;n; next thanks Romano Quote Link to comment Share on other sites More sharing options...
steven-g Posted September 15, 2014 Share Posted September 15, 2014 This will merge 2 layers called "different" and "merged", the command will delete layer "different" ^C^C^C-laymrg;n;different;;n;merged;y; Quote Link to comment Share on other sites More sharing options...
Gentile Romano Posted September 15, 2014 Author Share Posted September 15, 2014 (edited) Thanks steven for your response i don't want this way, i can't type the layer names their I would like to know is there any way for this Regards Romano Edited September 15, 2014 by Gentile Romano space Quote Link to comment Share on other sites More sharing options...
Gentile Romano Posted September 15, 2014 Author Share Posted September 15, 2014 (edited) sorry, the last image should come first......... I need some can fast merge layers (this happens, when more people works with same cad file) Ex; Layer names 1. Asphalt Edge 2. ASPHALTEDGE 3. ROAD ASPHALT EDGE 4. ROAD EDGE 5. ROAD_EDGE 6. ASPHALT-ROAD.................all these are one item thanks Romano Edited September 15, 2014 by Gentile Romano clearing Quote Link to comment Share on other sites More sharing options...
steven-g Posted September 15, 2014 Share Posted September 15, 2014 You cannot get a macro to work with dialogue boxes, thats one of the limitations of using a macro. So you either need to supply the names in the macro, or run the command from a toolbar/command line. Quote Link to comment Share on other sites More sharing options...
YZ Posted September 22, 2014 Share Posted September 22, 2014 Do you work for surveyors? It looks like they need to fix their coding and layering. I might not understand exactly what you want, but if you know all the possible asphalt layer names, you can write a macro that will combine them all into 1. The hyphen "-" before the command "-LAYMRG" will stop any dialog box from appearing. To me that is the best way to the macro to help you save time. This one puts the first 5 from your list all into layer 6: ^C^C-LAYMRG;Name;"Asphalt Edge";Name;ASPHALTEDGE;Name;"ROAD ASPHALT EDGE";Name;"ROAD EDGE";Name;ROAD_EDGE;;Name;ASPHALT-ROAD;Yes; To be safer you might need to create the destination layer at the beginning of the macro. Something like: -LAYER;NEW;ASPHALT-ROAD;; Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 22, 2014 Share Posted September 22, 2014 Why do you insist on using a macro when you are running full AutoCAD and could use a custom lisp routine instead? Seems counter-intuitive. Quote Link to comment Share on other sites More sharing options...
Gentile Romano Posted September 22, 2014 Author Share Posted September 22, 2014 (edited) thanks yz & Remark replied to my Thread before designing the road the surveyors will create existing condition cad file, many surveyors will put there input and create it (number of surveys is depend on the area, if short time period) many surveyors cad files will merge into one cad file, merge means copy and paste to original coordinates (There is no standard Layer Name system) so each project survey data (cad file) with large Nos. of layers This survey file we use to attach as a xref to multipule dwgs as a reference we need to change the color as per dwg wise thanks you Romano Edited September 22, 2014 by Gentile Romano spelling Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 23, 2014 Share Posted September 23, 2014 (edited) Like Remark use a Lisp, Pick object destination layer, then pick object lay1, object lay2 etc all done. Search for a lisp that changes all objects on a layer to a new layer using ssget and layer filter is pretty easy. (defun c:chlays ( / deslay ss sslen newlay) (vl-load-com) (setq deslay (cdr (assoc 8 (entget (car (entsel "\npick object destination layer")))))) ;returns destination layer just use two lines again (while (setq newlay (cdr (assoc 8 (entget (car (entsel "\npick object next layer nothing to exit")))))) (setq ss (ssget "X" (list (cons 8 newlay)))) (setq sslen (sslength ss)) (setq x 0) (repeat sslen (setq obj (ssname ss x)) (setq vlobj (setq vlobj (vlax-ename->vla-object obj))) (vla-put-layer vlobj deslay) (setq x (+ x 1)) ) ; repeat (setq ss nil ) ) ; while ) ; defun (c:chlays) Edited September 23, 2014 by BIGAL Quote Link to comment Share on other sites More sharing options...
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.