Author Topic: Non-LISP Macros?  (Read 3297 times)

0 Members and 1 Guest are viewing this topic.

Kate M

  • Guest
Non-LISP Macros?
« on: August 15, 2008, 12:38:06 PM »
Anybody have any non-LISP-based macros they'd be willing to share?

I'm doing a class at AU on "customization without programming", and I need macros to use as examples. I have a few from my old place, but I'd like some from other industries (plus that saves me from having to come up with them myself. :evil: Besides, one of my favorites -- set LTSCALE based on DIMSCALE -- is now obsolete.)

I appreciate your help -- and of course full credit will be given for all macros. Heck, maybe this will become the "macro" thread. :-)

Bob Wahr

  • Guest
Re: Non-LISP Macros?
« Reply #1 on: August 15, 2008, 01:57:49 PM »
Don't do much with menu macros, but here's a little maintain before closing one that I helped a guy with.

Code: [Select]
C^C^P-layout set Model -layer s 0  zoom e .-purge a * no -layout set  zoom e 'spell _qsave No need to credit it if you use it.

skennedy

  • Guest
Re: Non-LISP Macros?
« Reply #2 on: September 17, 2008, 09:19:51 AM »
Here is one that I use daily.

^C^C_PROPERTIESCLOSE;^C^C_CLAYER;0;^C^C_-PURGE;a;;n;^C^C_Z;E;^C^C_QSAVE;

skennedy

  • Guest
Re: Non-LISP Macros?
« Reply #3 on: September 17, 2008, 09:25:51 AM »
This is a common one to set the linetype scale to half of the dimscale:

^C^C^C(setvar "ltscale" (* 0.5(getvar "dimscale" )));

This one will set the units to Architectural with a 1/256 precision, decimal degrees, 2 fractional places for display of angles, counter clockwise and will close the text window:

^C^C^C-units;4;256;1;2;0;n;graphscr;

craigr

  • Guest
Re: Non-LISP Macros?
« Reply #4 on: September 17, 2008, 11:49:16 AM »
Here is one I use on Older dwgs, to bring them to what settings we use now -

^C^C_PSPACE;-linetype;s;continuous;;celtscale;1;_ltscale;1;_snap;.05;grid;.1;snap;OFF;grid;off;mirrtext;0;ortho;on;osnap;off;UCSicon;off;Blipmode;off;coords;1;_qtext;0;^C^C_-PURGE;a;;n;z;extents;-style;arial;arial.ttf;.08;;;n;n;ltscale;1;-layer;on;*;;_highlight;1;snap;on;audit;y;-PURGE;a;;n;-PURGE;a;;n;-layer;lock;title_block;;

It was one of my first macros when I started learning them, then added & deleted from it over time. I haven't changed it for a few years though.

I just found another one that we use ALOT - *^C^C_osnap;off;_ID;INT;\BREAK;@-.05,0;@.1,0;

It breaks on each side of intersected lines. - It was a conglomeration from several people on the Autodesk discussion board back in 2000, they are Tracy Lincoln, Yoder, & Bill - (I had printed out the discussion & saved it).

I have MANY more, IF you want them.

craigr
« Last Edit: September 17, 2008, 12:03:51 PM by craigr »

Birdy

  • Guest
Re: Non-LISP Macros?
« Reply #5 on: September 17, 2008, 12:27:13 PM »
Kate, give Chris (aka Shinyhead) a shout. 
I believe his firm uses LT, and that he has it customized to the nines.

Shinyhead

  • Guest
Re: Non-LISP Macros?
« Reply #6 on: September 17, 2008, 12:39:59 PM »
Oooh, fun stuff this is!

Rectangular Revcloud

Here is one, rectangular revcloud.  Prompts for two points and makes a revcloud
This one sets it to have about 1/4" arc in paperspace, and draws them based on current dimscale (or 1:1 if in paperspace, yes it checks that too)

It also sets the layer to "NOTES", but set it to whatever layer you put your revclouds on.

^C^C-LAYER;S;NOTES;;rectangle;\\_setenv;users1;1;$m=$(if,$(eq,$(getvar,cvport),1),setenv;users1;1,setenv;users1;$(getvar,dimscale));REVCLOUD;A;"$m=$(*,.25,$(getenv,users1))";;o;l;n;


More to come

M-dub

  • Guest
Re: Non-LISP Macros?
« Reply #7 on: September 17, 2008, 12:43:13 PM »
I had a few listed here, but there are a couple with lisp integrated into them.

I was sure we had a similar thread to this some time ago.  I'll keep looking.

Shinyhead

  • Guest
Re: Non-LISP Macros?
« Reply #8 on: September 17, 2008, 12:44:32 PM »
Quartersawn Hatch

This will draw a woodhatch oriented to the face of the wood in section to show quartersawn lumber.  It will prompt you for the midpoint of a line along the face of the item being hatched, then will prompt you to click the area you want hatched.   Its for drawing millwork sections for really picky clients, LOL.


^C^C-LAYER;S;Hatch;;_UCS;NEW;MID;\HPORIGIN;0,0;UCS;N;OB;0,0,0;-BHATCH;AN;Y;P;WD1;.75;0;\;UCS;W;

Shinyhead

  • Guest
Re: Non-LISP Macros?
« Reply #9 on: September 17, 2008, 12:48:01 PM »
Rotate View

With LT making it harder to rotate the view in a viewport we created this.
Just be in an unlocked viewport and fire the command. It will prompt you for the rotation angle (absolute, not relative) and rotate the view.

^C^C_MS;_UCSFOLLOW;1;_UCS;N;z;\_UCSFOLLOW;0;_UCS;W

Shinyhead

  • Guest
Re: Non-LISP Macros?
« Reply #10 on: September 17, 2008, 12:53:05 PM »
Set and Display Dimscale

This will prompt you for the second part of the ratio scale (i.e. 16 for 1:16 (3/4"=1'-0") and sets dimscale to that value.  It will also display the current dimscale with modemacro (displays in the lower lefthand corner of your window in case your not familiar with this).  It will display in architectural scale format so it will probably choke if you use a different scaling format, so you civil guys are on your own with this one.

If you use Annotative scaling I wouldn't use this, there are much better ways to deal with annotation items but I know lots of folks still use dimscale primarily.

^C^C_dimscale;\_MODEMACRO;DIMSCALE=$M=$(RTOS,$(/,12,$(GETVAR,DIMSCALE)))"""=12"""_;
« Last Edit: September 17, 2008, 12:56:40 PM by Shinyhead »

Shinyhead

  • Guest
Re: Non-LISP Macros?
« Reply #11 on: September 17, 2008, 01:00:50 PM »
I have more, but most of them rely on a template, a large directory of script files or block library or they will choke, which stinks because they are the cool ones.

To give you an idea, I have have some macros that can pick out one of about 40 possible script files based on the clients ID number and the current dimscale, layer, or whatever other parameter I want.  Its a good way to make LT work in a lot more powerful fashion.

Shinyhead

  • Guest
Re: Non-LISP Macros?
« Reply #12 on: September 17, 2008, 01:08:54 PM »
Shelf Pin Holes

This is one of the most complex non-lisp macros I have written.

^C^C_UCS;NEW;\_setenv;pt1;0,0,0;_ID;\_setenv;pt2;$m=$(getvar,lastpoint);_CIRCLE;-1.37795,-3;.098425;-ARRAY;L;;R;"$m=$(FIX,$(+,$(/,$(-,$(*,$(INDEX,1,$(GETENV,PT2)),-1),6),1.2598),1))";2;-1.2598;-"$m=$(-,$(*,$(INDEX,0,$(GETENV,PT2)),-1),3.37795)";_UCS;W;

It draws shelf pin holes in section based on the 32mm cabinet system.

Catches, you have to click in the upper right hand corner first, and the lower left corner second.
Also that cabinet must be open to the right, not the left.
This uses some tricks to fool LT into saving some entered coordinates and may be useful to folks (setting lastpoint as one and setting a new ucs around another).   Good luck deciphering the rest.  I wrote the darn thing and it would take me a long time to figure out the math and order of operation.

Warning, do not play with the quotes, if you do you mess up the order in which diesel parses the command.  Quotes are used in diesel to delay portions of the code from being processed until the next time the interpeter fires.  Quotes are probably the hardest part of diesel to understand, but the one thing that can make it very useful if you have no other programming options.

CHulse

  • Swamp Rat
  • Posts: 504
Re: Non-LISP Macros?
« Reply #13 on: September 18, 2008, 06:56:35 AM »
Reset the scale list:

^C^C-scalelistedit;r;y;^C^C
Cary Hulse
Urban Forestry Manager
Wetland Studies and Solutions

Civil 3D 2020 & 2023

craigr

  • Guest
Re: Non-LISP Macros?
« Reply #14 on: September 19, 2008, 02:07:46 PM »
Anybody have any non-LISP-based macros they'd be willing to share?

I'm doing a class at AU on "customization without programming", and I need macros to use as examples. I have a few from my old place, but I'd like some from other industries (plus that saves me from having to come up with them myself. :evil: Besides, one of my favorites -- set LTSCALE based on DIMSCALE -- is now obsolete.)

I appreciate your help -- and of course full credit will be given for all macros. Heck, maybe this will become the "macro" thread. :-)

Kate,

Did you get enough?

craigr