Jump to content

New to creating custom commands


Recommended Posts

Posted

I know how to create macro commands as long as the macro string does not require a base point. What I am trying to do is create a macro that allows me to insert text with a bottom-center justify, at a 90 degree angle. Whats obviously stopping me is the fact that you need to specify a base point before entering the angle. It would be perfect if the base point could be specified as the last thing, but is there a way to even do that? Any ideas? I would greatly appreciate any help regarding this, even if the solution isn't to make a macro. :)

 

Thanks in advance!

Posted

Hello Commander Manick, welcome in the forum, Sir! :)

It's not hard to do that with a short Lisp routine. With a macro: try to insert the text in the origin, than start the MOVE command from the origin to ... and here you must click the destination point. The text should move with your cursor until you click the destination point.

I didn't test this solution, post again if you ned more help

Posted

I'm afraid I have no idea how to work with lisp files :(

I think I might have learned about half a year ago but obviously forgot if I did. Could you explain in more detail please?

Posted

Fuccaro was actually describing how to do it with a macro without using lisp.

 

Use the normal text command but specify 0,0 as the insert point, then "move" it from 0,0 to user pick point...Since 0,0 may be off the screen, when the macro selects the text item to move may have to use (entlast) versus "last" (so yeah maybe a little lisp is still needed..)

Posted

Thank you CarlB! Our new friend Manick needs to learn Lisp. Myself, I need to learn some English to make people better understand what I mean.

Posted

when the macro selects the text item to move may have to use (entlast) versus "last" (so yeah maybe a little lisp is still needed..)

last will work in 2008. Prior to 2008 (possibly 2006), last was last visible, since 2008 last is last made (totally confused me to start with).

 

Fuccaro, your English is good enough for me. :)

Posted

Thanks for your help everyone! Yeah I just didn't understand at first because I thought I had to use lisp in the process and also didn't fully grasp the exact proceedings. When you say "last" though, is that the same thing as using the space bar to repeat the last command I used?

 

So would the macro look like this?

 

"C^C^text j bc 0,0 0"

Posted

Text on command line:

Command: dt
TEXT
Current text style:  "Standard"  Text height:  0.2000  Annotative:  No
Specify start point of text or [Justify/Style]: j
Enter an option [Align/Fit/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR]: bc
Specify bottom-center point of text: 0,0
Specify height <0.2000>:
Specify rotation angle of text <0>:
Enter text: testing
Enter text:
Command: ro
ROTATE
Current positive angle in UCS:  ANGDIR=counterclockwise  ANGBASE=0
Select objects: l
1 found
Select objects:
Specify base point: 0,0
Specify rotation angle or [Copy/Reference] <0>: 90
Command: m
MOVE
Select objects: l
1 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0
Specify second point or <use first point as displacement>:

 

Converted to macro:

 

^C^Cdt;j;bc;0,0;;;\ro;l;;0,0;90;m;l;;0,0;\

Posted
When you say "last" though, is that the same thing as using the space bar to repeat the last command I used?
no, AutoCAD has 2 special selection tools. When you are asked to select objects, such as when erasing, moving etc. you can just type P for the previous selection or L for the last object. The Last object used to be the last drawn object visible but this has changed recently to the last drawn object anywhere.
Posted
Text on command line:

Command: dt
TEXT
Current text style:  "Standard"  Text height:  0.2000  Annotative:  No
Specify start point of text or [Justify/Style]: j
Enter an option [Align/Fit/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR]: bc
Specify bottom-center point of text: 0,0
Specify height <0.2000>:
Specify rotation angle of text <0>:
Enter text: testing
Enter text:
Command: ro
ROTATE
Current positive angle in UCS:  ANGDIR=counterclockwise  ANGBASE=0
Select objects: l
1 found
Select objects:
Specify base point: 0,0
Specify rotation angle or [Copy/Reference] <0>: 90
Command: m
MOVE
Select objects: l
1 found
Select objects:
Specify base point or [Displacement] <Displacement>: 0,0
Specify second point or <use first point as displacement>:

Converted to macro:

 

^C^Cdt;j;bc;0,0;;;\ro;l;;0,0;90;m;l;;0,0;\

 

Worked perfectly, thanks a lot! This will save me loads of time on my projects.

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