Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help needed with lisp or a macro

12 REPLIES 12
Reply
Message 1 of 13
paulkillick7643
586 Views, 12 Replies

Help needed with lisp or a macro

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 lisp / macro that browses to where our JPEG Aerial Photos are kept on out 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 build a lisp / Macro that will browse to the above filepath I would be very grateful as I'm really getting nowhere with this.

 

Thanks

 

Paul

Tags (2)
12 REPLIES 12
Message 2 of 13
dmfrazier
in reply to: paulkillick7643

FYI (for future reference), there is a specific forum for this type of question:

http://forums.autodesk.com/t5/AutoCAD-Customization/ct-p/AutoCADTopic1

 

However, this sounds like a job for Design Center.

 

There is a fairly simple way to open Design Center to a specific folder.  You could place this line of code in a button macro (modify the path as necessary):

(command "._adcnavigate" "M:\DATA\AERIAL_PHOTOS\2012\84235\RGB_10cm_1km_Jpeg_Tiles")

 

If the contents of the folder are static, a Tool Palette might work, too.

 

Edit:

P.S. You will have to replace backslashes (\) with foreslashes (/) in any paths.

Message 3 of 13
Charles_Shade
in reply to: dmfrazier

Nice.

 


@dmfrazier wrote:

 

Edit:

P.S. You will have to replace backslashes (\) with foreslashes (/) in any paths.



Does not the quotes in the Macro preclude the need to change the slashes?

 

Message 4 of 13
dmfrazier
in reply to: Charles_Shade

Try it both ways... Then you tell me!Smiley Wink

(Thanks for the kudos.)

Message 5 of 13
Charles_Shade
in reply to: dmfrazier

Man; you're gonna make me learn to fish?

Message 6 of 13
dmfrazier
in reply to: Charles_Shade

You didn't get that "expert elite" by taking hand-outs, did you?Smiley Tongue

I save the give-aways for the truly needy.

Message 7 of 13
Charles_Shade
in reply to: dmfrazier

I've stuck to foreslashes and no quotes. Makes the Macro cleaner and easier to read.Smiley Wink

Message 8 of 13
dmfrazier
in reply to: Charles_Shade

"foreslashes and no quotes"

The macro I posted was LISP code, so the quotes are necessary. The foreslashes can also be double backslashes.

Message 9 of 13

Thanks, with the slashes going forward we have a result, a little tweaking and all should be fine.

Message 10 of 13
Charles_Shade
in reply to: dmfrazier


@dmfrazier wrote:

"foreslashes and no quotes"

The macro I posted was LISP code, so the quotes are necessary. The foreslashes can also be double backslashes.


See now that I did not know.

I'm an LT user and do not have experience with Lisp. Is there something here that makes this Lisp code and not a Macro as was stated? To my ignorant eye it looks like a button Macro.

Message 11 of 13

I'm using AutoCad 2011 and in the Customize User Interface Properties box under command the description is Macro
Message 12 of 13
dmfrazier
in reply to: Charles_Shade

"I'm an LT user and do not have experience with Lisp."

Yes, I sensed that.Smiley Wink

 

"Is there something here that makes this Lisp code and not a Macro as was stated? To my ignorant eye it looks like a button Macro."

What makes it LISP code is the fact it is enclosed in parentheses.  If you tried to run (in LT) the code I posted, you'd get an error.  Non-LT AutoCAD interprets anything inside parentheses as LISP.  This particular line of LISP code is very similar to what you think of as "macro" syntax, but LISP uses different conventions.  In a sense, LISP is just another "macro" language.

It's only a "button macro" if you use it to define a toolbar button.  This code can also be run at the command line, or it could be defined as a named function and run within a larger LISP routine, or loaded and run as a "command".

Message 13 of 13

I'm not to sure myself but seems to work fine, as you can see from the attached where the Macro field is highlighted blue you can see the command.Lisp.JPG

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost