Cad2762 Posted October 22, 2013 Share Posted October 22, 2013 Hi All I cave created a new drop down menu using the Customize User Interface in AutoCad 2011 called Load Aerial Photography with a sub menu called Insert Tiles. When selecting my new menu I would like to have a macro that browses to where our JPEG Aerial Photos are kept on our network. At the moment I have to select the AutoCad pull down:- Insert, Raster Image Referance then browse to M:\DATA\AERIAL_PHOTOS\2012\84235\RGB_10cm_1km_Jpeg_Tiles If there is a user on this Forum who can put together a Macro that will browse to the above filepath I would be very grateful as I'm really getting nowhere with this. Thanks Paul Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 Is it possible that the slashes have to go the other way? Like this: / instead of like this \. According to a reference book I have the "/" character is used to define directories. Ex. - C:/0000/bolt.dwg Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 Is it possible that the slashes have to go the other way? Like this: / instead of like this \. The example I have given Isnt my attempt at writing the Macro its the long handed way of inserting a raster image into a drawing, what I need is someone with Macro experiance to put together a piece of Macro code that will look to the file path I have provided, hope that makes sense. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 You are writing a path to a directory. Reverse the slash. Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 You are writing a path to a directory. Reverse the slash. Thats the point i'm not writing anything as I don't have the experiance to write Macros, if you look at a macro it has instructins like (defun c:/ (((****)) etc Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 If you are looking at something like this... (defun c:addtxt ( / i n r s ) ...then aren't you using a lisp routine not a macro? Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 Here is an example of a complex macro (courtesy of CADTech Seminars). ^C^C_-layer;make;TAGS;color;red;;;_-insert;c:/blocks/tag.dwg;\96;96;;\_insert;c:/blocks/scale96.dwg;$m=$(getvar,lastpoint);96;96;;_pline;$m=$(getvar,lastpoint);w;1;;\;_insert;c:/block/tag2.dwg;end;\96;96;;\\plinewid;0; Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 If you are looking at something like this... (defun c:addtxt ( / i n r s ) ...then aren't you using a lisp routine not a macro? This is c copy from my CUI where it says Macro in the properties box (if c:a4comm nil (load "c:/data/lisp/a4comm"));a4comm; Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 That macro is calling a lisp routine. Do you know what a lisp routine is? Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 Would you know how to put a Macro together that allow my to insert my JPEG using Insert, Raster Image Referance M:\DATA\AERIAL_PHOTOS\2012\84235\RGB_10cm_1km_Jpeg _Tiles? Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 How's this? ^C^C-insert;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg_Tiles/insert tile name with file type here; Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 An example of a short lisp routine as created by forum member Lee Mac. See the difference between a macro and a lisp routine? Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 Yes, It's because if you loog at the image you will see in the properties box the lisp routing is title Macro. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 That's your comeback? We're beyond that now. I wrote what I considered to be a macro that will insert a jpeg located according to the path you provided. All you have to do is add the complete file name, add the macro to your CUI and test. Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 How's this? ^C^C-insert;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg_Tiles/insert tile name with file type here; Thanks but I had tried this already, I think the problem is -insert only allows .dwg and .dxf and not jpeg files, to get a raster image in you have to use insert, Raster Image Referance or imageattach Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2013 Share Posted October 22, 2013 Now I'm not so sure. Is there any way to invoke IMAGEATTACH without opening a dialog box? Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 I have already tried this and it does not work, thanks for your imput though Quote Link to comment Share on other sites More sharing options...
Tuns Posted October 22, 2013 Share Posted October 22, 2013 ^C^C-insert;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg _Tiles;\1;0; Does this work? Quote Link to comment Share on other sites More sharing options...
Cad2762 Posted October 22, 2013 Author Share Posted October 22, 2013 ^C^C-insert;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg _Tiles;\1;0; Does this work? Thanks but got the message in the picture Quote Link to comment Share on other sites More sharing options...
Tuns Posted October 22, 2013 Share Posted October 22, 2013 -image;attach;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg _Tiles;\1;0; How about this? Make sure the file path and image name is correct. 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.