Jump to content

Recommended Posts

Posted

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

  • 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

Posted

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

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

Posted

You are writing a path to a directory. Reverse the slash.

Posted
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

Posted

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?

Posted

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;

Posted
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;

Posted

That macro is calling a lisp routine. Do you know what a lisp routine is?

Posted

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?

Posted

How's this?

 

^C^C-insert;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg_Tiles/insert tile name with file type here;

Posted

SampleLispRoutine.JPG

An example of a short lisp routine as created by forum member Lee Mac.

See the difference between a macro and a lisp routine?

Posted

Yes, It's because if you loog at the image you will see in the properties box the lisp routing is title Macro.CUI.JPG

Posted

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.

Posted
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

Posted

Now I'm not so sure. Is there any way to invoke IMAGEATTACH without opening a dialog box?

Posted

I have already tried this and it does not work, thanks for your imput though

Posted

^C^C-insert;M:/DATA/AERIAL_PHOTOS/2012/84235/RGB_10cm_1km_Jpeg _Tiles;\1;0;

Does this work?

Posted
^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

 

cui2.jpg

Posted

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

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