Jump to content

Help needed with a Macro please


Cad2762

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

  • Cad2762

    19

  • ReMark

    17

  • Tuns

    6

  • dbroada

    2

Top Posters In This Topic

Posted Images

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

-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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...