Map 3D Drawing Query Macro
Have you ever wanted to import just a portion of another drawing into your current drawing? I know the civil engineering world frequently needs to import specific data from one map to another. Since I work in that world and because I’m lazy, I created a quick method for importing data from standard maps into new drawings using queries and macros.
If you are at all familiar with creating queries in Map 3D, you already know it is possible to do what I mentioned above. If you are not familiar with queries, simply put, a query is a way to grab entities from another drawing, based on object data and properties, and bring it into your current drawing. In this tip I am not going to get into the details of creating queries, but I am going to show you how to make a simple macro to import everything from one drawing into another, within the area of a rectangle. You need Map 3D or Civil 3D to do this.
Create a button, and add this code to the command macro:
^C^Ccmddia;0;ZOOM;EXTENTS;ADEDRAWINGS;at;C:/YOUR/DRAWING/PATH/DrawingName.dwg;x;adequery;p;of;x;c;d;l;w;c;\\p;and;la;*;x;e;d;ADEDRAWINGS;de;DrawingName.dwg;x;cmddia;1;REGENALL;
Replace “C:/YOUR/DRAWING/PATH/DrawingName.dwg” with the path to the drawing from which you want to import objects. Be sure to use forward slashes (/). If you use back slashes (\) it will pause the macro for user input.
Also be sure to replace the second “DrawingName.dwg” with the name of the same drawing you specified above.
That’s all there is to it! Click on the button you created, click two points to create a rectangle, and if there are objects in the rectangular area you specified, they will appear in your current drawing.











Map 3D Drawing Query Macro…
You’ve been kicked (a good thing) - Trackback from CadKicks.com…