tool palette macros

tool palette macros

Michael.cook101
Participant Participant
900 Views
10 Replies
Message 1 of 11

tool palette macros

Michael.cook101
Participant
Participant

Using AutoCad version 13 or 14

I am trying to combine two macros on a tool palette.  Command one works and command two works.

I want to combine them into one command, so that I can add the text in the same keystroke.

I have blocks created for Vanity Size 24” up to 96” approx.  every 3”.

I want to place the block in the plan then place the text as needed.

Thanks for your help

Michael Cook

michael.cook101@gmail.com

 

Macro Command one

^C^Cosmode 163;lst_APLUMFIXT;-insert;VAN24_1BOS=n:/MC_BLOCKS/LIB/PLUMBING/VANITY/VAN24_1BOS;scale;;

 

 

(Set Osmode to 163)

 

(lst_APLUMFIXT ) lisp routine to set layer to A-PLUM-FIXT

 

(-insert;VAN24_1BOS=n:/MC_BLOCKS/LIB/PLUMBING/VANITY/VAN24_1BOS;scale;;) insert a block and rotate it

 

Macro Command two

^C^Cosmode 163;lst_AANNOTEXT;-text;J;BC;\\VANITY 24;;;;

 

 

(Set Osmode to 163)

 

(lst_AANNOTEXT ) lisp routine to set layer to A-ANNO-TEXT

 

(-text;J;BC;\\VANITY 24;;;;) pick point and place text, it uses the current text style

 

I want to combine both macros into one instead of two macros.  Can this be done???

Thanks MikeC

0 Likes
Accepted solutions (1)
901 Views
10 Replies
Replies (10)
Message 2 of 11

Kent1Cooper
Consultant
Consultant

I would think all you need is a couple of \'s at the end of the first one, for the User to give the insertion point and rotation of the Block, and then the contents of the second one:

 

^C^Cosmode 163 lst_APLUMFIXT -insert VAN24_1BOS=n:/MC_BLOCKS/LIB/PLUMBING/VANITY/VAN24_1BOS scale;;\\lst_AANNOTEXT -text;J;BC \\VANITY 24;;;;

 

 

Kent Cooper, AIA
0 Likes
Message 3 of 11

Michael.cook101
Participant
Participant
Accepted solution

After some trial an error I and research on line ( 4 hours  worth)  I finally got it to work....

this is the final syntax 

^C^Cosmode 163;lst_APLUMFIXT;-insert;VAN24_1BNS=n:/MC_BLOCKS/LIB/PLUMBING/VANITY/VAN24_1BNS;scale;;\\lst_AANNOTEXT;^C^C;-text;J;BC;\\VAN 24;;;;

 

in the area of the "scale" comment was the issue.

thanks for your help

0 Likes
Message 4 of 11

Sea-Haven
Mentor
Mentor

Why not add n:/MC_BLOCKS/LIB/PLUMBING/VANITY/ to your search path, then only need VAN24_1BOS in your macro.

 

There was a un documented method of using 3 ... on the end of the path this allowed a search further down the directory so in this case would be n:\MC_BLOCKS\LIB... but it appears to have been turned off in say 2018+, any comments would be appreciated. It may be tied to "Working path".

0 Likes
Message 5 of 11

Michael.cook101
Participant
Participant

I thought about that.

I have an extensive library that I try to keep organized.

Blocks are stored in various folders.

In some cases I am doing a lot in one command.

Set osmode

Set layer to insert the block

Insert the block

Set layer again to text layer

Add text.

I do not think the standard tool pallet can do all of that, some command I have do more.

 

I really try hard to make my library accurate and the tools to do as much as they can.

Thanks for the advice and the reply.

 

MikeC

Owner Operator 

Cadman101:

 

 

0 Likes
Message 6 of 11

Kent1Cooper
Consultant
Consultant

@Michael.cook101 wrote:

....

in the area of the "scale" comment was the issue.

....


It looks, from the differences between mine and yours [apart from the ...BNS vs. ...BOS difference, and my use of spaces in place of some of your semicolons], like the issue was really with the lst_AANNOTEXT command, if you had to throw in a cancel before the Text part.  Is that command not completing properly on its own?

 

But also, if you're calling for the Scale option in the INSERT command, and accepting its default with Enter, since the default is always 1, can't you do without that option entirely?  [Who would scale a vanity other than to a scale factor of 1?]  Yes, you need to answer two scale factor prompts, but that's simpler than invoking the Scale option:

 

.... /VAN24_1BNS;\;;\lst_AANNOTEXT ....

 

[pause for User input at insertion point and rotation angle]

Kent Cooper, AIA
0 Likes
Message 7 of 11

Michael.cook101
Participant
Participant

After some trial an error attempts.  I was trying to skip the scale step in the process of insertion the block. I normally do not use the scale option while inserting a block.  Just wanted to insert at a point and rotate if needed then place text.

 

The  lst_AANNOTEXT command is a separate Lisp command that need to run to set the layer prior to text placement.

 

Again most of this is trial in error trying to find the correct sequence and usage of special symbols. 

0 Likes
Message 8 of 11

Sea-Haven
Mentor
Mentor

If the macros are getting to complicated maybe add some lisp defuns (doblock1 "blkname")(dotext1 "text") these can have way more in them, I have a lisp called autoload.lsp which has all these little defuns in it bigger lisps are loaded using the AUTOLOAD function so save memory.

0 Likes
Message 9 of 11

Michael.cook101
Participant
Participant

I agree,

I also have a bunch of small lisp routines that do quick task.

Over the last few day I had some down time (no work at the moment).  I spent that time working on my blocks and menus that need help.

Adding a tool that can handle three or four task in one stroke. Is always a good thing.

learning how the macros work was my first goal and that has been accomplished (for the time being LOL). Until I need to figure out another command.

 

Thanks for all your help.

MikeC

Owner Operator

Cadman101

 

0 Likes
Message 10 of 11

Sea-Haven
Mentor
Mentor

There is another shortcut on directory paths you can map a drive say x: = n:/MC_BLOCKS/LIB/PLUMBING/

 

I will try to find out what happenned to the 3 period option made life so much easier. The Bricscad guys are pretty good at replying to questions like this.

0 Likes
Message 11 of 11

Michael.cook101
Participant
Participant

I have a command loaded in the start up menu that maps additional drive letters.

The file is saved as mapdrive.bat in my Start Menu of the Workstation

 

netuse * /delete /y
subst K: C:\CADLIB
subst N: C:\N-DRIVE
subst S: C:\S-DRIVE

 

I have been using this one for many years, I no longer need to reparation hard drive to organize my folders.

This also helps if I do work for a client that requires a specific folder structure to match with there office standards.

 

Thanks for your input.

MikeC

Owner Operator 

Cadman101:

 

0 Likes